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