Преглед на файлове

Special case when there are no tox users on the network

Bob Mottram преди 9 години
родител
ревизия
673a79bdcf
No account linked to committer's email
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5
    1
      src/freedombone-image-customise

+ 5
- 1
src/freedombone-image-customise Целия файл

@@ -715,7 +715,11 @@ function configure_user_interface {
715 715
     cat <<EOF > $rootdir/usr/bin/list-tox-users
716 716
 #!/bin/bash
717 717
 users_list=\$(lstox | awk -F ' ' '{\$1=""; print \$0}' | sed -e 's/^[[:space:]]*//' | sort -d)
718
-no_of_users=\$(echo "\$users_list" | wc -l)
718
+if [ ! \$users_list ]; then
719
+    no_of_users=0
720
+else
721
+    no_of_users=\$(echo "\$users_list" | wc -l)
722
+fi
719 723
 if [ \$no_of_users -gt 0 ]; then
720 724
     echo "\$users_list" > /home/$MY_USERNAME/Users.txt
721 725
     chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Users.txt