optionally include a mail subdomain code

This commit is contained in:
Bob Mottram 2016-10-26 12:13:55 +01:00
parent 1bbe27a724
commit c338679069
2 changed files with 13 additions and 3 deletions

View File

@ -190,9 +190,10 @@ function choose_default_domain_name {
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
dialog --backtitle $"Freedombone Configuration" \ dialog --backtitle $"Freedombone Configuration" \
--title $"Your main domain name" \ --title $"Your main domain name" \
--form $"\nWhich domain name should your email/XMPP/IRC/Mumble be associated with?" 11 55 3 \ --form $"\nWhich domain name should your email/XMPP/IRC/Mumble be associated with?" 12 55 4 \
$"Domain:" 1 1 "$(grep 'DEFAULT_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 33 40 \ $"Domain:" 1 1 "$(grep 'DEFAULT_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 24 33 40 \
$"Code:" 2 1 "$(grep 'DEFAULT_DOMAIN_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 16 33 255 \ $"Code:" 2 1 "$(grep 'DEFAULT_DOMAIN_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 24 33 255 \
$"mail subdomain Code:" 3 1 "$(grep 'EMAIL_DOMAIN_CODE' temp.cfg | awk -F '=' '{print $2}')" 3 24 33 255 \
2> $data 2> $data
sel=$? sel=$?
case $sel in case $sel in
@ -201,12 +202,20 @@ function choose_default_domain_name {
esac esac
DEFAULT_DOMAIN_NAME=$(cat $data | sed -n 1p) DEFAULT_DOMAIN_NAME=$(cat $data | sed -n 1p)
DEFAULT_DOMAIN_CODE=$(cat $data | sed -n 2p) DEFAULT_DOMAIN_CODE=$(cat $data | sed -n 2p)
EMAIL_DOMAIN_CODE=$(cat $data | sed -n 2p)
if [ $DEFAULT_DOMAIN_NAME ]; then if [ $DEFAULT_DOMAIN_NAME ]; then
validate_freedns_code "$DEFAULT_DOMAIN_CODE" validate_freedns_code "$DEFAULT_DOMAIN_CODE"
if [ ! $VALID_CODE ]; then if [ ! $VALID_CODE ]; then
DEFAULT_DOMAIN_NAME= DEFAULT_DOMAIN_NAME=
fi fi
fi fi
if [ $EMAIL_DOMAIN_CODE ]; then
validate_freedns_code "$EMAIL_DOMAIN_CODE"
if [ ! $VALID_CODE ]; then
DEFAULT_DOMAIN_NAME=
EMAIL_DOMAIN_CODE=
fi
fi
else else
dialog --backtitle $"Freedombone Configuration" \ dialog --backtitle $"Freedombone Configuration" \
--inputbox $"Which domain name should your email/XMPP/IRC/Mumble be associated with?" 10 45 \ --inputbox $"Which domain name should your email/XMPP/IRC/Mumble be associated with?" 10 45 \

View File

@ -47,6 +47,7 @@ configuration_variables=(FRIENDS_MIRRORS_SERVER
DOMAIN_NAME DOMAIN_NAME
DEFAULT_DOMAIN_NAME DEFAULT_DOMAIN_NAME
DEFAULT_DOMAIN_CODE DEFAULT_DOMAIN_CODE
EMAIL_DOMAIN_CODE
NAMESERVER1 NAMESERVER1
NAMESERVER2 NAMESERVER2
GET_IP_ADDRESS_URL GET_IP_ADDRESS_URL