Special case when there are no tox users on the network
This commit is contained in:
parent
d20e0dc15a
commit
673a79bdcf
|
@ -715,7 +715,11 @@ function configure_user_interface {
|
||||||
cat <<EOF > $rootdir/usr/bin/list-tox-users
|
cat <<EOF > $rootdir/usr/bin/list-tox-users
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
users_list=\$(lstox | awk -F ' ' '{\$1=""; print \$0}' | sed -e 's/^[[:space:]]*//' | sort -d)
|
users_list=\$(lstox | awk -F ' ' '{\$1=""; print \$0}' | sed -e 's/^[[:space:]]*//' | sort -d)
|
||||||
|
if [ ! \$users_list ]; then
|
||||||
|
no_of_users=0
|
||||||
|
else
|
||||||
no_of_users=\$(echo "\$users_list" | wc -l)
|
no_of_users=\$(echo "\$users_list" | wc -l)
|
||||||
|
fi
|
||||||
if [ \$no_of_users -gt 0 ]; then
|
if [ \$no_of_users -gt 0 ]; then
|
||||||
echo "\$users_list" > /home/$MY_USERNAME/Users.txt
|
echo "\$users_list" > /home/$MY_USERNAME/Users.txt
|
||||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Users.txt
|
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Users.txt
|
||||||
|
|
Loading…
Reference in New Issue