This commit is contained in:
Bob Mottram 2016-08-28 09:58:07 +01:00
parent 0df2c9ca7a
commit 9bcd603d71
1 changed files with 2 additions and 2 deletions

View File

@ -77,10 +77,10 @@ if [ ! $EMAIL_ADDRESS ]; then
exit 1 exit 1
fi fi
USERNAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $1}')
if [ ! $NEW_USER_PASSWORD ]; then if [ ! $NEW_USER_PASSWORD ]; then
prosodyctl adduser $EMAIL_ADDRESS prosodyctl adduser $EMAIL_ADDRESS
else else
USERNAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $1}')
DOMAIN_NAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $2}') DOMAIN_NAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $2}')
prosodyctl register $USERNAME $DOMAIN_NAME "$NEW_USER_PASSWORD" prosodyctl register $USERNAME $DOMAIN_NAME "$NEW_USER_PASSWORD"
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -91,7 +91,7 @@ fi
# add the xmpp address to email headers # add the xmpp address to email headers
if [ -f /home/$USERNAME/.muttrc ]; then if [ -f /home/$USERNAME/.muttrc ]; then
if ! grep -q "Jabber-ID" /home/$USERNAME/.muttrc; then if ! grep -q "Jabber-ID" /home/$USERNAME/.muttrc; then
echo "my_hdr Jabber-ID: ${USERNAME}@${HOSTNAME}" >> /home/$USERNAME/.muttrc echo "my_hdr Jabber-ID: $EMAIL_ADDRESS" >> /home/$USERNAME/.muttrc
fi fi
fi fi