Avoid duplicate domain names

This commit is contained in:
Bob Mottram 2015-01-18 14:46:07 +00:00
parent 189f85aa71
commit f2248f9503
1 changed files with 80 additions and 84 deletions

View File

@ -583,51 +583,49 @@ function interactive_configuration {
255) exit 0;; 255) exit 0;;
esac esac
data=$(tempfile 2>/dev/null) while [ ! $DDNS_USERNAME ]
trap "rm -f $data" 0 1 2 5 15 do
dialog --backtitle "Freedombone Configuration" \ data=$(tempfile 2>/dev/null)
--inputbox "Dynamic DNS provider username" 10 30 2> $data trap "rm -f $data" 0 1 2 5 15
sel=$? dialog --backtitle "Freedombone Configuration" \
case $sel in --inputbox "Dynamic DNS provider username" 10 30 2> $data
0) DDNS_USERNAME=$(cat $data);; sel=$?
1) exit 0;; case $sel in
255) exit 0;; 0) DDNS_USERNAME=$(cat $data);;
esac 1) exit 0;;
if [ ! $DDNS_USERNAME ]; then 255) exit 0;;
exit 5245 esac
fi done
data=$(tempfile 2>/dev/null) while [ ! $DDNS_PASSWORD ]
trap "rm -f $data" 0 1 2 5 15 do
dialog --backtitle "Freedombone Configuration" \ data=$(tempfile 2>/dev/null)
--clear \ trap "rm -f $data" 0 1 2 5 15
--insecure \ dialog --backtitle "Freedombone Configuration" \
--passwordbox "Dynamic DNS provider password" 10 30 2> $data --clear \
sel=$? --insecure \
case $sel in --passwordbox "Dynamic DNS provider password" 10 30 2> $data
0) DDNS_PASSWORD=$(cat $data);; sel=$?
1) exit 0;; case $sel in
255) exit 0;; 0) DDNS_PASSWORD=$(cat $data);;
esac 1) exit 0;;
data=$(tempfile 2>/dev/null) 255) exit 0;;
trap "rm -f $data" 0 1 2 5 15 esac
if [ ! $DDNS_PASSWORD ]; then done
exit 7229
fi
data=$(tempfile 2>/dev/null) while [ ! $MY_NAME ]
trap "rm -f $data" 0 1 2 5 15 do
dialog --backtitle "Freedombone Configuration" \ data=$(tempfile 2>/dev/null)
--inputbox "Your full name (or nick)" 10 30 2> $data trap "rm -f $data" 0 1 2 5 15
sel=$? dialog --backtitle "Freedombone Configuration" \
case $sel in --inputbox "Your full name (or nick)" 10 30 2> $data
0) MY_NAME=$(cat $data);; sel=$?
1) exit 0;; case $sel in
255) exit 0;; 0) MY_NAME=$(cat $data);;
esac 1) exit 0;;
if [ ! $MY_NAME ]; then 255) exit 0;;
exit 3784 esac
fi done
data=$(tempfile 2>/dev/null) data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15 trap "rm -f $data" 0 1 2 5 15
@ -644,14 +642,6 @@ function interactive_configuration {
esac esac
LOCAL_NETWORK_STATIC_IP_ADDRESS=$(cat $data | sed -n 1p) LOCAL_NETWORK_STATIC_IP_ADDRESS=$(cat $data | sed -n 1p)
ROUTER_IP_ADDRESS=$(cat $data | sed -n 2p) ROUTER_IP_ADDRESS=$(cat $data | sed -n 2p)
echo "local $LOCAL_NETWORK_STATIC_IP_ADDRESS"
echo "router $ROUTER_IP_ADDRESS"
if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
exit 6950
fi
if [ ! $ROUTER_IP_ADDRESS ]; then
exit 7582
fi
data=$(tempfile 2>/dev/null) data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15 trap "rm -f $data" 0 1 2 5 15
@ -734,6 +724,9 @@ function interactive_configuration {
esac esac
MY_BLOG_TITLE=$(cat $data | sed -n 1p) MY_BLOG_TITLE=$(cat $data | sed -n 1p)
FULLBLOG_DOMAIN_NAME=$(cat $data | sed -n 2p) FULLBLOG_DOMAIN_NAME=$(cat $data | sed -n 2p)
if [[ $FULLBLOG_DOMAIN_NAME == "$WIKI_DOMAIN_NAME" ]]; then
FULLBLOG_DOMAIN_NAME=""
fi
done done
if [ ! $DOMAIN_NAME ]; then if [ ! $DOMAIN_NAME ]; then
DOMAIN_NAME=$FULLBLOG_DOMAIN_NAME DOMAIN_NAME=$FULLBLOG_DOMAIN_NAME
@ -845,6 +838,9 @@ function interactive_configuration {
255) exit 0;; 255) exit 0;;
esac esac
MICROBLOG_DOMAIN_NAME=$(cat $data | sed -n 1p) MICROBLOG_DOMAIN_NAME=$(cat $data | sed -n 1p)
if [[ $MICROBLOG_DOMAIN_NAME == "$REDMATRIX_DOMAIN_NAME" ]]; then
MICROBLOG_DOMAIN_NAME=""
fi
done done
if [ ! $DOMAIN_NAME ]; then if [ ! $DOMAIN_NAME ]; then
DOMAIN_NAME=$MICROBLOG_DOMAIN_NAME DOMAIN_NAME=$MICROBLOG_DOMAIN_NAME
@ -858,50 +854,50 @@ function interactive_configuration {
fi fi
if [ ! $DOMAIN_NAME ]; then if [ ! $DOMAIN_NAME ]; then
data=$(tempfile 2>/dev/null) while [ ! $DOMAIN_NAME ]
trap "rm -f $data" 0 1 2 5 15 do
dialog --backtitle "Freedombone Configuration" \
--inputbox "Domain name" 10 30 2> $data
sel=$?
case $sel in
0) DOMAIN_NAME=$(cat $data);;
1) exit 0;;
255) exit 0;;
esac
if [ ! $DOMAIN_NAME ]; then
exit 3846
fi
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
data=$(tempfile 2>/dev/null) data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15 trap "rm -f $data" 0 1 2 5 15
dialog --backtitle "Freedombone Configuration" \ dialog --backtitle "Freedombone Configuration" \
--inputbox "FreeDNS subdomain code" 10 30 2> $data --inputbox "Domain name" 10 30 2> $data
sel=$? sel=$?
case $sel in case $sel in
0) FREEDNS_SUBDOMAIN_CODE=$(cat $data);; 0) DOMAIN_NAME=$(cat $data);;
1) exit 0;; 1) exit 0;;
255) exit 0;; 255) exit 0;;
esac esac
if [ ! $FREEDNS_SUBDOMAIN_CODE ]; then done
exit 7422
fi if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
while [ ! $FREEDNS_SUBDOMAIN_CODE ]
do
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle "Freedombone Configuration" \
--inputbox "FreeDNS subdomain code" 10 30 2> $data
sel=$?
case $sel in
0) FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
1) exit 0;;
255) exit 0;;
esac
done
fi fi
fi fi
data=$(tempfile 2>/dev/null) while [ ! $MY_EMAIL_ADDRESS ]
trap "rm -f $data" 0 1 2 5 15 do
dialog --backtitle "Freedombone Configuration" \ data=$(tempfile 2>/dev/null)
--inputbox "Your email address" 10 30 "$MY_USERNAME@$DOMAIN_NAME" 2> $data trap "rm -f $data" 0 1 2 5 15
sel=$? dialog --backtitle "Freedombone Configuration" \
case $sel in --inputbox "Your email address" 10 30 "$MY_USERNAME@$DOMAIN_NAME" 2> $data
0) MY_EMAIL_ADDRESS=$(cat $data);; sel=$?
1) exit 0;; case $sel in
255) exit 0;; 0) MY_EMAIL_ADDRESS=$(cat $data);;
esac 1) exit 0;;
if [ ! $MY_EMAIL_ADDRESS ]; then 255) exit 0;;
exit 8357 esac
fi done
save_configuration_file save_configuration_file