From 5a0e192f48fe176874766bb9fc9951de8a3a1d06 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 2 Nov 2015 10:33:03 +0000 Subject: [PATCH] Check that xmpp is installed before adding user --- src/freedombone-adduser | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/freedombone-adduser b/src/freedombone-adduser index ba46daad..f01894ac 100755 --- a/src/freedombone-adduser +++ b/src/freedombone-adduser @@ -178,12 +178,14 @@ chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README chown $MY_USERNAME:$MY_USERNAME $MY_GPG_PUBLIC_KEY chmod 600 /home/$MY_USERNAME/README -echo "Adding an XMPP account for $MY_USERNAME" -freedombone-addxmpp -e "$MY_USERNAME@$HOSTNAME" -p "$NEW_USER_PASSWORD" -if [ ! "$?" = "0" ]; then - echo "XMPP account not created" - userdel -r $MY_USERNAME - exit 8 +if grep -q "install_xmpp" $COMPLETION_FILE; then + echo "Adding an XMPP account for $MY_USERNAME" + freedombone-addxmpp -e "$MY_USERNAME@$HOSTNAME" -p "$NEW_USER_PASSWORD" + if [ ! "$?" = "0" ]; then + echo "XMPP account not created" + userdel -r $MY_USERNAME + exit 8 + fi fi if grep -q "Blog domain" $COMPLETION_FILE; then