Skip to content
Snippets Groups Projects
Commit f7899d65 authored by Bob Mottram's avatar Bob Mottram
Browse files

Count users in a better way

parent 9f056124
No related branches found
No related tags found
No related merge requests found
......@@ -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">';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment