Avoid duplicate domain names
This commit is contained in:
parent
189f85aa71
commit
f2248f9503
164
src/freedombone
164
src/freedombone
|
@ -583,51 +583,49 @@ function interactive_configuration {
|
|||
255) exit 0;;
|
||||
esac
|
||||
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Dynamic DNS provider username" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) DDNS_USERNAME=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $DDNS_USERNAME ]; then
|
||||
exit 5245
|
||||
fi
|
||||
while [ ! $DDNS_USERNAME ]
|
||||
do
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Dynamic DNS provider username" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) DDNS_USERNAME=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
done
|
||||
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--clear \
|
||||
--insecure \
|
||||
--passwordbox "Dynamic DNS provider password" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) DDNS_PASSWORD=$(cat $data);;
|
||||
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
|
||||
while [ ! $DDNS_PASSWORD ]
|
||||
do
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--clear \
|
||||
--insecure \
|
||||
--passwordbox "Dynamic DNS provider password" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) DDNS_PASSWORD=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
done
|
||||
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Your full name (or nick)" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) MY_NAME=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $MY_NAME ]; then
|
||||
exit 3784
|
||||
fi
|
||||
while [ ! $MY_NAME ]
|
||||
do
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Your full name (or nick)" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) MY_NAME=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
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,50 +854,50 @@ function interactive_configuration {
|
|||
fi
|
||||
|
||||
if [ ! $DOMAIN_NAME ]; then
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
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
|
||||
while [ ! $DOMAIN_NAME ]
|
||||
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
|
||||
--inputbox "Domain name" 10 30 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
|
||||
0) DOMAIN_NAME=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $FREEDNS_SUBDOMAIN_CODE ]; then
|
||||
exit 7422
|
||||
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" \
|
||||
--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
|
||||
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Your email address" 10 30 "$MY_USERNAME@$DOMAIN_NAME" 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) MY_EMAIL_ADDRESS=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
if [ ! $MY_EMAIL_ADDRESS ]; then
|
||||
exit 8357
|
||||
fi
|
||||
while [ ! $MY_EMAIL_ADDRESS ]
|
||||
do
|
||||
data=$(tempfile 2>/dev/null)
|
||||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --backtitle "Freedombone Configuration" \
|
||||
--inputbox "Your email address" 10 30 "$MY_USERNAME@$DOMAIN_NAME" 2> $data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0) MY_EMAIL_ADDRESS=$(cat $data);;
|
||||
1) exit 0;;
|
||||
255) exit 0;;
|
||||
esac
|
||||
done
|
||||
|
||||
save_configuration_file
|
||||
|
||||
|
|
Loading…
Reference in New Issue