From 9bcd603d7165a134c9bfed334c03d9c7a557d65a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 28 Aug 2016 09:58:07 +0100 Subject: [PATCH] Simplify --- src/freedombone-addxmpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedombone-addxmpp b/src/freedombone-addxmpp index aebc13cc..f23db9cf 100755 --- a/src/freedombone-addxmpp +++ b/src/freedombone-addxmpp @@ -77,10 +77,10 @@ if [ ! $EMAIL_ADDRESS ]; then exit 1 fi +USERNAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $1}') if [ ! $NEW_USER_PASSWORD ]; then prosodyctl adduser $EMAIL_ADDRESS 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 @@ -91,7 +91,7 @@ fi # add the xmpp address to email headers if [ -f /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