From 673a79bdcf166393444dabaa3cfe144822fc4f30 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 24 Aug 2016 09:09:12 +0100 Subject: [PATCH] Special case when there are no tox users on the network --- src/freedombone-image-customise | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 120dfd6d..adcbc467 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -715,7 +715,11 @@ function configure_user_interface { cat < $rootdir/usr/bin/list-tox-users #!/bin/bash users_list=\$(lstox | awk -F ' ' '{\$1=""; print \$0}' | sed -e 's/^[[:space:]]*//' | sort -d) -no_of_users=\$(echo "\$users_list" | wc -l) +if [ ! \$users_list ]; then + no_of_users=0 +else + no_of_users=\$(echo "\$users_list" | wc -l) +fi if [ \$no_of_users -gt 0 ]; then echo "\$users_list" > /home/$MY_USERNAME/Users.txt chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Users.txt