Skip to content
Snippets Groups Projects
Commit 20d65a0b authored by Bob Mottram's avatar Bob Mottram
Browse files

Check return code

parent 93f6cbb1
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,11 @@ 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 6
fi
clear
echo "New user $MY_USERNAME was created"
......
......@@ -64,11 +64,12 @@ done
if [ ! -d /etc/prosody ]; then
echo 'xmpp server is not installed'
exit 1
exit 0
fi
if [ ! $EMAIL_ADDRESS ]; then
show_help
exit 1
fi
if [ ! $NEW_USER_PASSWORD ]; then
......@@ -77,6 +78,9 @@ else
USERNAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $1}')
DOMAIN_NAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $2}')
prosodyctl register $USERNAME $DOMAIN_NAME "$NEW_USER_PASSWORD"
if [ ! "$?" = "0" ]; then
exit 2
fi
fi
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment