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;; 255) exit 0;;
esac esac
while [ ! $DDNS_USERNAME ]
do
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" \
@ -593,10 +595,10 @@ function interactive_configuration {
1) exit 0;; 1) exit 0;;
255) exit 0;; 255) exit 0;;
esac esac
if [ ! $DDNS_USERNAME ]; then done
exit 5245
fi
while [ ! $DDNS_PASSWORD ]
do
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" \
@ -609,12 +611,10 @@ function interactive_configuration {
1) exit 0;; 1) exit 0;;
255) exit 0;; 255) exit 0;;
esac esac
data=$(tempfile 2>/dev/null) done
trap "rm -f $data" 0 1 2 5 15
if [ ! $DDNS_PASSWORD ]; then
exit 7229
fi
while [ ! $MY_NAME ]
do
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" \
@ -625,9 +625,7 @@ function interactive_configuration {
1) exit 0;; 1) exit 0;;
255) exit 0;; 255) exit 0;;
esac esac
if [ ! $MY_NAME ]; then done
exit 3784
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
@ -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,6 +854,8 @@ function interactive_configuration {
fi fi
if [ ! $DOMAIN_NAME ]; then if [ ! $DOMAIN_NAME ]; then
while [ ! $DOMAIN_NAME ]
do
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" \
@ -868,11 +866,11 @@ function interactive_configuration {
1) exit 0;; 1) exit 0;;
255) exit 0;; 255) exit 0;;
esac esac
if [ ! $DOMAIN_NAME ]; then done
exit 3846
fi
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
while [ ! $FREEDNS_SUBDOMAIN_CODE ]
do
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" \
@ -883,12 +881,12 @@ function interactive_configuration {
1) exit 0;; 1) exit 0;;
255) exit 0;; 255) exit 0;;
esac esac
if [ ! $FREEDNS_SUBDOMAIN_CODE ]; then done
exit 7422
fi
fi fi
fi fi
while [ ! $MY_EMAIL_ADDRESS ]
do
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" \
@ -899,9 +897,7 @@ function interactive_configuration {
1) exit 0;; 1) exit 0;;
255) exit 0;; 255) exit 0;;
esac esac
if [ ! $MY_EMAIL_ADDRESS ]; then done
exit 8357
fi
save_configuration_file save_configuration_file