Bob Mottram 8 vuotta sitten
vanhempi
commit
9bcd603d71
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2
    2
      src/freedombone-addxmpp

+ 2
- 2
src/freedombone-addxmpp Näytä tiedosto

77
     exit 1
77
     exit 1
78
 fi
78
 fi
79
 
79
 
80
+USERNAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $1}')
80
 if [ ! $NEW_USER_PASSWORD ]; then
81
 if [ ! $NEW_USER_PASSWORD ]; then
81
     prosodyctl adduser $EMAIL_ADDRESS
82
     prosodyctl adduser $EMAIL_ADDRESS
82
 else
83
 else
83
-    USERNAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $1}')
84
     DOMAIN_NAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $2}')
84
     DOMAIN_NAME=$(echo $EMAIL_ADDRESS | awk -F '@' '{print $2}')
85
     prosodyctl register $USERNAME $DOMAIN_NAME "$NEW_USER_PASSWORD"
85
     prosodyctl register $USERNAME $DOMAIN_NAME "$NEW_USER_PASSWORD"
86
     if [ ! "$?" = "0" ]; then
86
     if [ ! "$?" = "0" ]; then
91
 # add the xmpp address to email headers
91
 # add the xmpp address to email headers
92
 if [ -f /home/$USERNAME/.muttrc ]; then
92
 if [ -f /home/$USERNAME/.muttrc ]; then
93
     if ! grep -q "Jabber-ID" /home/$USERNAME/.muttrc; then
93
     if ! grep -q "Jabber-ID" /home/$USERNAME/.muttrc; then
94
-        echo "my_hdr Jabber-ID: ${USERNAME}@${HOSTNAME}" >> /home/$USERNAME/.muttrc
94
+        echo "my_hdr Jabber-ID: $EMAIL_ADDRESS" >> /home/$USERNAME/.muttrc
95
     fi
95
     fi
96
 fi
96
 fi
97
 
97