diff --git a/src/freedombone-utils-webadmin b/src/freedombone-utils-webadmin index c5bc7c8e03b650559e3ee204509e6941dfcd41f0..f16abeb2e5911b0a3a2668b71b0688b931229b4b 100755 --- a/src/freedombone-utils-webadmin +++ b/src/freedombone-utils-webadmin @@ -299,6 +299,8 @@ function web_admin_create_users { rm "$webadmin_install_dir/userprofile_"* + no_of_users=0 + for d in /home/*/ ; do USERNAME=$(echo "$d" | awk -F '/' '{print $3}') if [[ $(is_valid_user "$USERNAME") == "1" ]]; then @@ -338,6 +340,8 @@ function web_admin_create_users { echo ' </a>'; echo ' </div>'; } >> "$users_file" + no_of_users=$((no_of_users+1)) + cp "$webadmin_install_dir"/userprofile.html "$userfile" sed -i "s|USERNAME|${USERNAME}|g" "$userfile" if [[ "$USERNAME" == "$ADMIN_USER" ]]; then @@ -363,9 +367,6 @@ function web_admin_create_users { translated_add_user=$(web_admin_translate_text "Add a new member") - # shellcheck disable=SC2126 - no_of_users=$(find /home/ -maxdepth 1 -type d | grep -Fxv "/home/znc" | grep -Fxv "/home/turtl" | grep -Fxv "/home/go" | grep -Fxv "/home/gogs" | grep -Fxv "/home/git" | grep -Fxv "/home/pihole" | grep -Fxv "/home/" | grep -Fxv "/home/tahoelafs" | grep -Fxv "/home/sync" | wc -l) - # shellcheck disable=SC2086 if [ $no_of_users -lt $MAXIMUM_USERS ]; then { echo ' <div class="chip">';