Check return code
This commit is contained in:
parent
93f6cbb1e8
commit
20d65a0b7a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue