Loop until something happens
This commit is contained in:
parent
442fc05c88
commit
189f85aa71
220
src/freedombone
220
src/freedombone
|
@ -666,53 +666,40 @@ function interactive_configuration {
|
||||||
255) exit 0;;
|
255) exit 0;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
|
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
|
||||||
|
while [ ! $WIKI_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
|
||||||
|
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||||
dialog --backtitle "Freedombone Configuration" \
|
dialog --backtitle "Freedombone Configuration" \
|
||||||
--inputbox "Wiki Title" 10 30 2> $data
|
--title "Wiki Configuration" \
|
||||||
|
--form "\nPlease enter your wiki details:" 11 55 4 \
|
||||||
|
"Title:" 1 1 "My Wiki" 1 16 16 15 \
|
||||||
|
"Domain:" 2 1 "" 2 16 16 15 \
|
||||||
|
"FreeDNS code:" 3 1 "" 3 16 16 15 \
|
||||||
|
2> $data
|
||||||
|
else
|
||||||
|
dialog --backtitle "Freedombone Configuration" \
|
||||||
|
--title "Wiki Configuration" \
|
||||||
|
--form "\nPlease enter your wiki details:" 11 55 3 \
|
||||||
|
"Title:" 1 1 "My Wiki" 1 16 16 15 \
|
||||||
|
"Domain:" 2 1 "" 2 16 16 15 \
|
||||||
|
2> $data
|
||||||
|
fi
|
||||||
sel=$?
|
sel=$?
|
||||||
case $sel in
|
case $sel in
|
||||||
0) WIKI_TITLE=$(cat $data);;
|
|
||||||
1) exit 0;;
|
1) exit 0;;
|
||||||
255) exit 0;;
|
255) exit 0;;
|
||||||
esac
|
esac
|
||||||
if [ ! $WIKI_TITLE ]; then
|
WIKI_TITLE=$(cat $data | sed -n 1p)
|
||||||
exit 5638
|
WIKI_DOMAIN_NAME=$(cat $data | sed -n 2p)
|
||||||
fi
|
done
|
||||||
|
|
||||||
data=$(tempfile 2>/dev/null)
|
|
||||||
trap "rm -f $data" 0 1 2 5 15
|
|
||||||
dialog --backtitle "Freedombone Configuration" \
|
|
||||||
--inputbox "Wiki domain name" 10 30 2> $data
|
|
||||||
sel=$?
|
|
||||||
case $sel in
|
|
||||||
0) WIKI_DOMAIN_NAME=$(cat $data);;
|
|
||||||
1) exit 0;;
|
|
||||||
255) exit 0;;
|
|
||||||
esac
|
|
||||||
if [ ! $WIKI_DOMAIN_NAME ]; then
|
|
||||||
exit 9236
|
|
||||||
fi
|
|
||||||
if [ ! $DOMAIN_NAME ]; then
|
if [ ! $DOMAIN_NAME ]; then
|
||||||
DOMAIN_NAME=$WIKI_DOMAIN_NAME
|
DOMAIN_NAME=$WIKI_DOMAIN_NAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||||
data=$(tempfile 2>/dev/null)
|
WIKI_FREEDNS_SUBDOMAIN_CODE=$(cat $data | sed -n 3p)
|
||||||
trap "rm -f $data" 0 1 2 5 15
|
|
||||||
dialog --backtitle "Freedombone Configuration" \
|
|
||||||
--inputbox "Wiki FreeDNS subdomain code" 10 30 2> $data
|
|
||||||
sel=$?
|
|
||||||
case $sel in
|
|
||||||
0) WIKI_FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
|
|
||||||
1) exit 0;;
|
|
||||||
255) exit 0;;
|
|
||||||
esac
|
|
||||||
if [ ! $WIKI_FREEDNS_SUBDOMAIN_CODE ]; then
|
|
||||||
exit 5277
|
|
||||||
fi
|
|
||||||
if [[ $DOMAIN_NAME == "$WIKI_DOMAIN_NAME" ]]; then
|
if [[ $DOMAIN_NAME == "$WIKI_DOMAIN_NAME" ]]; then
|
||||||
FREEDNS_SUBDOMAIN_CODE=$WIKI_FREEDNS_SUBDOMAIN_CODE
|
FREEDNS_SUBDOMAIN_CODE=$WIKI_FREEDNS_SUBDOMAIN_CODE
|
||||||
fi
|
fi
|
||||||
|
@ -720,151 +707,152 @@ function interactive_configuration {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
|
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
|
||||||
|
while [ ! $FULLBLOG_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" \
|
|
||||||
--inputbox "Blog Title" 10 30 2> $data
|
|
||||||
sel=$?
|
|
||||||
case $sel in
|
|
||||||
0) MY_BLOG_TITLE=$(cat $data);;
|
|
||||||
1) exit 0;;
|
|
||||||
255) exit 0;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ $MY_BLOG_TITLE ]; then
|
|
||||||
data=$(tempfile 2>/dev/null)
|
|
||||||
trap "rm -f $data" 0 1 2 5 15
|
|
||||||
dialog --backtitle "Freedombone Configuration" \
|
|
||||||
--inputbox "Blog domain name" 10 30 2> $data
|
|
||||||
sel=$?
|
|
||||||
case $sel in
|
|
||||||
0) FULLBLOG_DOMAIN_NAME=$(cat $data);;
|
|
||||||
1) exit 0;;
|
|
||||||
255) exit 0;;
|
|
||||||
esac
|
|
||||||
if [ ! $FULLBLOG_DOMAIN_NAME ]; then
|
|
||||||
exit 7648
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||||
data=$(tempfile 2>/dev/null)
|
|
||||||
trap "rm -f $data" 0 1 2 5 15
|
|
||||||
dialog --backtitle "Freedombone Configuration" \
|
dialog --backtitle "Freedombone Configuration" \
|
||||||
--inputbox "Blog FreeDNS subdomain code" 10 30 2> $data
|
--title "Blog Configuration" \
|
||||||
|
--form "\nPlease enter your blog details:" 11 55 4 \
|
||||||
|
"Title:" 1 1 "My Blog" 1 16 16 15 \
|
||||||
|
"Domain:" 2 1 "" 2 16 16 15 \
|
||||||
|
"FreeDNS code:" 3 1 "" 3 16 16 15 \
|
||||||
|
2> $data
|
||||||
|
else
|
||||||
|
dialog --backtitle "Freedombone Configuration" \
|
||||||
|
--title "Blog Configuration" \
|
||||||
|
--form "\nPlease enter your blog details:" 11 55 3 \
|
||||||
|
"Title:" 1 1 "My Blog" 1 16 16 15 \
|
||||||
|
"Domain:" 2 1 "" 2 16 16 15 \
|
||||||
|
2> $data
|
||||||
|
fi
|
||||||
sel=$?
|
sel=$?
|
||||||
case $sel in
|
case $sel in
|
||||||
0) FULLBLOG_FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
|
|
||||||
1) exit 0;;
|
1) exit 0;;
|
||||||
255) exit 0;;
|
255) exit 0;;
|
||||||
esac
|
esac
|
||||||
if [ ! $FULLBLOG_FREEDNS_SUBDOMAIN_CODE ]; then
|
MY_BLOG_TITLE=$(cat $data | sed -n 1p)
|
||||||
exit 9875
|
FULLBLOG_DOMAIN_NAME=$(cat $data | sed -n 2p)
|
||||||
|
done
|
||||||
|
if [ ! $DOMAIN_NAME ]; then
|
||||||
|
DOMAIN_NAME=$FULLBLOG_DOMAIN_NAME
|
||||||
fi
|
fi
|
||||||
|
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||||
|
FULLBLOG_FREEDNS_SUBDOMAIN_CODE=$(cat $data | sed -n 3p)
|
||||||
|
if [[ $DOMAIN_NAME == "$FULLBLOG_DOMAIN_NAME" ]]; then
|
||||||
|
FREEDNS_SUBDOMAIN_CODE=$FULLBLOG_FREEDNS_SUBDOMAIN_CODE
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
|
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
|
||||||
|
while [ ! $OWNCLOUD_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
|
||||||
|
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||||
dialog --backtitle "Freedombone Configuration" \
|
dialog --backtitle "Freedombone Configuration" \
|
||||||
--inputbox "Owncloud domain name" 10 30 2> $data
|
--title "Owncloud Configuration" \
|
||||||
|
--form "\nPlease enter your Owncloud details:" 11 55 3 \
|
||||||
|
"Domain:" 1 1 "" 1 16 16 15 \
|
||||||
|
"FreeDNS code:" 2 1 "" 2 16 16 15 \
|
||||||
|
2> $data
|
||||||
|
else
|
||||||
|
dialog --backtitle "Freedombone Configuration" \
|
||||||
|
--title "Owncloud Configuration" \
|
||||||
|
--form "\nPlease enter your Owncloud details:" 11 55 3 \
|
||||||
|
"Domain:" 1 1 "" 1 16 16 15 \
|
||||||
|
2> $data
|
||||||
|
fi
|
||||||
sel=$?
|
sel=$?
|
||||||
case $sel in
|
case $sel in
|
||||||
0) OWNCLOUD_DOMAIN_NAME=$(cat $data);;
|
|
||||||
1) exit 0;;
|
1) exit 0;;
|
||||||
255) exit 0;;
|
255) exit 0;;
|
||||||
esac
|
esac
|
||||||
|
OWNCLOUD_DOMAIN_NAME=$(cat $data | sed -n 1p)
|
||||||
if [ $OWNCLOUD_DOMAIN_NAME ]; then
|
done
|
||||||
if [ ! $DOMAIN_NAME ]; then
|
if [ ! $DOMAIN_NAME ]; then
|
||||||
DOMAIN_NAME=$OWNCLOUD_DOMAIN_NAME
|
DOMAIN_NAME=$OWNCLOUD_DOMAIN_NAME
|
||||||
fi
|
fi
|
||||||
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||||
data=$(tempfile 2>/dev/null)
|
OWNCLOUD_FREEDNS_SUBDOMAIN_CODE=$(cat $data | sed -n 2p)
|
||||||
trap "rm -f $data" 0 1 2 5 15
|
|
||||||
dialog --backtitle "Freedombone Configuration" \
|
|
||||||
--inputbox "Owncloud FreeDNS subdomain code" 10 30 2> $data
|
|
||||||
sel=$?
|
|
||||||
case $sel in
|
|
||||||
0) OWNCLOUD_FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
|
|
||||||
1) exit 0;;
|
|
||||||
255) exit 0;;
|
|
||||||
esac
|
|
||||||
if [ ! $OWNCLOUD_FREEDNS_SUBDOMAIN_CODE ]; then
|
|
||||||
exit 2583
|
|
||||||
fi
|
|
||||||
if [[ $DOMAIN_NAME == "$OWNCLOUD_DOMAIN_NAME" ]]; then
|
if [[ $DOMAIN_NAME == "$OWNCLOUD_DOMAIN_NAME" ]]; then
|
||||||
FREEDNS_SUBDOMAIN_CODE=$OWNCLOUD_FREEDNS_SUBDOMAIN_CODE
|
FREEDNS_SUBDOMAIN_CODE=$OWNCLOUD_FREEDNS_SUBDOMAIN_CODE
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
|
if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
|
||||||
|
while [ ! $REDMATRIX_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
|
||||||
|
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||||
dialog --backtitle "Freedombone Configuration" \
|
dialog --backtitle "Freedombone Configuration" \
|
||||||
--inputbox "RedMatrix domain name" 10 30 2> $data
|
--title "RedMatrix Configuration" \
|
||||||
|
--form "\nPlease enter your RedMatrix details:" 11 55 3 \
|
||||||
|
"Domain:" 1 1 "" 1 16 16 15 \
|
||||||
|
"FreeDNS code:" 2 1 "" 2 16 16 15 \
|
||||||
|
2> $data
|
||||||
|
else
|
||||||
|
dialog --backtitle "Freedombone Configuration" \
|
||||||
|
--title "RedMatrix Configuration" \
|
||||||
|
--form "\nPlease enter your RedMatrix details:" 11 55 3 \
|
||||||
|
"Domain:" 1 1 "" 1 16 16 15 \
|
||||||
|
2> $data
|
||||||
|
fi
|
||||||
sel=$?
|
sel=$?
|
||||||
case $sel in
|
case $sel in
|
||||||
0) REDMATRIX_DOMAIN_NAME=$(cat $data);;
|
|
||||||
1) exit 0;;
|
1) exit 0;;
|
||||||
255) exit 0;;
|
255) exit 0;;
|
||||||
esac
|
esac
|
||||||
|
REDMATRIX_DOMAIN_NAME=$(cat $data | sed -n 1p)
|
||||||
if [ $REDMATRIX_DOMAIN_NAME ]; then
|
done
|
||||||
if [ ! $DOMAIN_NAME ]; then
|
if [ ! $DOMAIN_NAME ]; then
|
||||||
DOMAIN_NAME=$REDMATRIX_DOMAIN_NAME
|
DOMAIN_NAME=$REDMATRIX_DOMAIN_NAME
|
||||||
fi
|
fi
|
||||||
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||||
data=$(tempfile 2>/dev/null)
|
REDMATRIX_FREEDNS_SUBDOMAIN_CODE=$(cat $data | sed -n 2p)
|
||||||
trap "rm -f $data" 0 1 2 5 15
|
|
||||||
dialog --backtitle "Freedombone Configuration" \
|
|
||||||
--inputbox "RedMatrix FreeDNS subdomain code" 10 30 2> $data
|
|
||||||
sel=$?
|
|
||||||
case $sel in
|
|
||||||
0) REDMATRIX_FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
|
|
||||||
1) exit 0;;
|
|
||||||
255) exit 0;;
|
|
||||||
esac
|
|
||||||
if [ ! $REDMATRIX_FREEDNS_SUBDOMAIN_CODE ]; then
|
|
||||||
exit 9654
|
|
||||||
fi
|
|
||||||
if [[ $DOMAIN_NAME == "$REDMATRIX_DOMAIN_NAME" ]]; then
|
if [[ $DOMAIN_NAME == "$REDMATRIX_DOMAIN_NAME" ]]; then
|
||||||
FREEDNS_SUBDOMAIN_CODE=$REDMATRIX_FREEDNS_SUBDOMAIN_CODE
|
FREEDNS_SUBDOMAIN_CODE=$REDMATRIX_FREEDNS_SUBDOMAIN_CODE
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
|
if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
|
||||||
|
while [ ! $MICROBLOG_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" \
|
|
||||||
--inputbox "Microblog domain name" 10 30 2> $data
|
|
||||||
sel=$?
|
|
||||||
case $sel in
|
|
||||||
0) MICROBLOG_DOMAIN_NAME=$(cat $data);;
|
|
||||||
1) exit 0;;
|
|
||||||
255) exit 0;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ $MICROBLOG_DOMAIN_NAME ]; then
|
|
||||||
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||||
data=$(tempfile 2>/dev/null)
|
|
||||||
trap "rm -f $data" 0 1 2 5 15
|
|
||||||
dialog --backtitle "Freedombone Configuration" \
|
dialog --backtitle "Freedombone Configuration" \
|
||||||
--inputbox "Microblog FreeDNS subdomain code" 10 30 2> $data
|
--title "Microblog Configuration" \
|
||||||
|
--form "\nPlease enter your Microblog details:" 11 55 3 \
|
||||||
|
"Domain:" 1 1 "" 1 16 16 15 \
|
||||||
|
"FreeDNS code:" 2 1 "" 2 16 16 15 \
|
||||||
|
2> $data
|
||||||
|
else
|
||||||
|
dialog --backtitle "Freedombone Configuration" \
|
||||||
|
--title "Microblog Configuration" \
|
||||||
|
--form "\nPlease enter your Microblog details:" 11 55 3 \
|
||||||
|
"Domain:" 1 1 "" 1 16 16 15 \
|
||||||
|
2> $data
|
||||||
|
fi
|
||||||
sel=$?
|
sel=$?
|
||||||
case $sel in
|
case $sel in
|
||||||
0) MICROBLOG_FREEDNS_SUBDOMAIN_CODE=$(cat $data);;
|
|
||||||
1) exit 0;;
|
1) exit 0;;
|
||||||
255) exit 0;;
|
255) exit 0;;
|
||||||
esac
|
esac
|
||||||
if [ ! $MICROBLOG_FREEDNS_SUBDOMAIN_CODE ]; then
|
MICROBLOG_DOMAIN_NAME=$(cat $data | sed -n 1p)
|
||||||
exit 9508
|
done
|
||||||
|
if [ ! $DOMAIN_NAME ]; then
|
||||||
|
DOMAIN_NAME=$MICROBLOG_DOMAIN_NAME
|
||||||
fi
|
fi
|
||||||
|
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||||
|
MICROBLOG_FREEDNS_SUBDOMAIN_CODE=$(cat $data | sed -n 2p)
|
||||||
|
if [[ $DOMAIN_NAME == "$MICROBLOG_DOMAIN_NAME" ]]; then
|
||||||
|
FREEDNS_SUBDOMAIN_CODE=$MICROBLOG_FREEDNS_SUBDOMAIN_CODE
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue