Better handling of the freedns code

This commit is contained in:
Bob Mottram 2015-01-18 15:03:41 +00:00
parent f2248f9503
commit abd244b1a3
1 changed files with 79 additions and 49 deletions

View File

@ -684,17 +684,23 @@ function interactive_configuration {
esac
WIKI_TITLE=$(cat $data | sed -n 1p)
WIKI_DOMAIN_NAME=$(cat $data | sed -n 2p)
done
if [ $WIKI_DOMAIN_NAME ]; then
if [ ! $DOMAIN_NAME ]; then
DOMAIN_NAME=$WIKI_DOMAIN_NAME
fi
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
WIKI_FREEDNS_SUBDOMAIN_CODE=$(cat $data | sed -n 3p)
if [ ! $WIKI_FREEDNS_SUBDOMAIN_CODE ]; then
WIKI_DOMAIN_NAME=""
else
if [[ $DOMAIN_NAME == "$WIKI_DOMAIN_NAME" ]]; then
FREEDNS_SUBDOMAIN_CODE=$WIKI_FREEDNS_SUBDOMAIN_CODE
fi
fi
fi
fi
done
fi
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
while [ ! $FULLBLOG_DOMAIN_NAME ]
@ -724,20 +730,26 @@ function interactive_configuration {
esac
MY_BLOG_TITLE=$(cat $data | sed -n 1p)
FULLBLOG_DOMAIN_NAME=$(cat $data | sed -n 2p)
if [ $FULLBLOG_DOMAIN_NAME ]; then
if [[ $FULLBLOG_DOMAIN_NAME == "$WIKI_DOMAIN_NAME" ]]; then
FULLBLOG_DOMAIN_NAME=""
fi
done
if [ ! $DOMAIN_NAME ]; then
DOMAIN_NAME=$FULLBLOG_DOMAIN_NAME
fi
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
FULLBLOG_FREEDNS_SUBDOMAIN_CODE=$(cat $data | sed -n 3p)
if [ ! $FULLBLOG_FREEDNS_SUBDOMAIN_CODE ]; then
FULLBLOG_DOMAIN_NAME=""
else
if [[ $DOMAIN_NAME == "$FULLBLOG_DOMAIN_NAME" ]]; then
FREEDNS_SUBDOMAIN_CODE=$FULLBLOG_FREEDNS_SUBDOMAIN_CODE
fi
fi
fi
fi
done
fi
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
while [ ! $OWNCLOUD_DOMAIN_NAME ]
@ -764,17 +776,23 @@ function interactive_configuration {
255) exit 0;;
esac
OWNCLOUD_DOMAIN_NAME=$(cat $data | sed -n 1p)
done
if [ $OWNCLOUD_DOMAIN_NAME ]; then
if [ ! $DOMAIN_NAME ]; then
DOMAIN_NAME=$OWNCLOUD_DOMAIN_NAME
fi
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
OWNCLOUD_FREEDNS_SUBDOMAIN_CODE=$(cat $data | sed -n 2p)
if [ ! $OWNCLOUD_FREEDNS_SUBDOMAIN_CODE ]; then
OWNCLOUD_DOMAIN_NAME=""
else
if [[ $DOMAIN_NAME == "$OWNCLOUD_DOMAIN_NAME" ]]; then
FREEDNS_SUBDOMAIN_CODE=$OWNCLOUD_FREEDNS_SUBDOMAIN_CODE
fi
fi
fi
fi
done
fi
if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
while [ ! $REDMATRIX_DOMAIN_NAME ]
@ -801,17 +819,23 @@ function interactive_configuration {
255) exit 0;;
esac
REDMATRIX_DOMAIN_NAME=$(cat $data | sed -n 1p)
done
if [ $REDMATRIX_DOMAIN_NAME ]; then
if [ ! $DOMAIN_NAME ]; then
DOMAIN_NAME=$REDMATRIX_DOMAIN_NAME
fi
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
REDMATRIX_FREEDNS_SUBDOMAIN_CODE=$(cat $data | sed -n 2p)
if [ ! $REDMATRIX_FREEDNS_SUBDOMAIN_CODE ]; then
REDMATRIX_DOMAIN_NAME=""
else
if [[ $DOMAIN_NAME == "$REDMATRIX_DOMAIN_NAME" ]]; then
FREEDNS_SUBDOMAIN_CODE=$REDMATRIX_FREEDNS_SUBDOMAIN_CODE
fi
fi
fi
fi
done
fi
if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
while [ ! $MICROBLOG_DOMAIN_NAME ]
@ -838,20 +862,26 @@ function interactive_configuration {
255) exit 0;;
esac
MICROBLOG_DOMAIN_NAME=$(cat $data | sed -n 1p)
if [ $MICROBLOG_DOMAIN_NAME ]; then
if [[ $MICROBLOG_DOMAIN_NAME == "$REDMATRIX_DOMAIN_NAME" ]]; then
MICROBLOG_DOMAIN_NAME=""
fi
done
if [ ! $DOMAIN_NAME ]; then
DOMAIN_NAME=$MICROBLOG_DOMAIN_NAME
fi
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
MICROBLOG_FREEDNS_SUBDOMAIN_CODE=$(cat $data | sed -n 2p)
if [ ! $MICROBLOG_FREEDNS_SUBDOMAIN_CODE ]; then
MICROBLOG_DOMAIN_NAME=""
else
if [[ $DOMAIN_NAME == "$MICROBLOG_DOMAIN_NAME" ]]; then
FREEDNS_SUBDOMAIN_CODE=$MICROBLOG_FREEDNS_SUBDOMAIN_CODE
fi
fi
fi
fi
done
fi
if [ ! $DOMAIN_NAME ]; then
while [ ! $DOMAIN_NAME ]