瀏覽代碼

Special case when there are no tox users on the network

Bob Mottram 9 年之前
父節點
當前提交
673a79bdcf
沒有帳戶連結到提交者的電子郵件
共有 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