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,6 +583,8 @@ function interactive_configuration {
255) exit 0;;
esac
while [ ! $DDNS_USERNAME ]
do
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle "Freedombone Configuration" \
@ -593,10 +595,10 @@ function interactive_configuration {
1) exit 0;;
255) exit 0;;
esac
if [ ! $DDNS_USERNAME ]; then
exit 5245
fi
done
while [ ! $DDNS_PASSWORD ]
do
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle "Freedombone Configuration" \
@ -609,12 +611,10 @@ function interactive_configuration {
1) exit 0;;
255) exit 0;;
esac
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
if [ ! $DDNS_PASSWORD ]; then
exit 7229
fi
done
while [ ! $MY_NAME ]
do
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle "Freedombone Configuration" \
@ -625,9 +625,7 @@ function interactive_configuration {
1) exit 0;;
255) exit 0;;
esac
if [ ! $MY_NAME ]; then
exit 3784
fi
done
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
@ -644,14 +642,6 @@ function interactive_configuration {
esac
LOCAL_NETWORK_STATIC_IP_ADDRESS=$(cat $data | sed -n 1p)
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)
trap "rm -f $data" 0 1 2 5 15
@ -734,6 +724,9 @@ function interactive_configuration {
esac
MY_BLOG_TITLE=$(cat $data | sed -n 1p)
FULLBLOG_DOMAIN_NAME=$(cat $data | sed -n 2p)
if [[ $FULLBLOG_DOMAIN_NAME == "$WIKI_DOMAIN_NAME" ]]; then
FULLBLOG_DOMAIN_NAME=""
fi
done
if [ ! $DOMAIN_NAME ]; then
DOMAIN_NAME=$FULLBLOG_DOMAIN_NAME
@ -845,6 +838,9 @@ function interactive_configuration {
255) exit 0;;
esac
MICROBLOG_DOMAIN_NAME=$(cat $data | sed -n 1p)
if [[ $MICROBLOG_DOMAIN_NAME == "$REDMATRIX_DOMAIN_NAME" ]]; then
MICROBLOG_DOMAIN_NAME=""
fi
done
if [ ! $DOMAIN_NAME ]; then
DOMAIN_NAME=$MICROBLOG_DOMAIN_NAME
@ -858,6 +854,8 @@ function interactive_configuration {
fi
if [ ! $DOMAIN_NAME ]; then
while [ ! $DOMAIN_NAME ]
do
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle "Freedombone Configuration" \
@ -868,11 +866,11 @@ function interactive_configuration {
1) exit 0;;
255) exit 0;;
esac
if [ ! $DOMAIN_NAME ]; then
exit 3846
fi
done
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" \
@ -883,12 +881,12 @@ function interactive_configuration {
1) exit 0;;
255) exit 0;;
esac
if [ ! $FREEDNS_SUBDOMAIN_CODE ]; then
exit 7422
fi
done
fi
fi
while [ ! $MY_EMAIL_ADDRESS ]
do
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle "Freedombone Configuration" \
@ -899,9 +897,7 @@ function interactive_configuration {
1) exit 0;;
255) exit 0;;
esac
if [ ! $MY_EMAIL_ADDRESS ]; then
exit 8357
fi
done
save_configuration_file