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,16 +684,22 @@ function interactive_configuration {
esac
WIKI_TITLE=$(cat $data | sed -n 1p)
WIKI_DOMAIN_NAME=$(cat $data | sed -n 2p)
done
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 [[ $DOMAIN_NAME == "$WIKI_DOMAIN_NAME" ]]; then
FREEDNS_SUBDOMAIN_CODE=$WIKI_FREEDNS_SUBDOMAIN_CODE
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
fi
done
fi
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
@ -724,19 +730,25 @@ 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=""
if [ $FULLBLOG_DOMAIN_NAME ]; then
if [[ $FULLBLOG_DOMAIN_NAME == "$WIKI_DOMAIN_NAME" ]]; then
FULLBLOG_DOMAIN_NAME=""
fi
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
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 [[ $DOMAIN_NAME == "$FULLBLOG_DOMAIN_NAME" ]]; then
FREEDNS_SUBDOMAIN_CODE=$FULLBLOG_FREEDNS_SUBDOMAIN_CODE
fi
fi
fi
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
@ -764,16 +776,22 @@ function interactive_configuration {
255) exit 0;;
esac
OWNCLOUD_DOMAIN_NAME=$(cat $data | sed -n 1p)
done
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 [[ $DOMAIN_NAME == "$OWNCLOUD_DOMAIN_NAME" ]]; then
FREEDNS_SUBDOMAIN_CODE=$OWNCLOUD_FREEDNS_SUBDOMAIN_CODE
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
fi
done
fi
if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
@ -801,16 +819,22 @@ function interactive_configuration {
255) exit 0;;
esac
REDMATRIX_DOMAIN_NAME=$(cat $data | sed -n 1p)
done
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 [[ $DOMAIN_NAME == "$REDMATRIX_DOMAIN_NAME" ]]; then
FREEDNS_SUBDOMAIN_CODE=$REDMATRIX_FREEDNS_SUBDOMAIN_CODE
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
fi
done
fi
if [[ $SYSTEM_TYPE == "$VARIANT_SOCIAL" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
@ -838,19 +862,25 @@ 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=""
if [ $MICROBLOG_DOMAIN_NAME ]; then
if [[ $MICROBLOG_DOMAIN_NAME == "$REDMATRIX_DOMAIN_NAME" ]]; then
MICROBLOG_DOMAIN_NAME=""
fi
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
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 [[ $DOMAIN_NAME == "$MICROBLOG_DOMAIN_NAME" ]]; then
FREEDNS_SUBDOMAIN_CODE=$MICROBLOG_FREEDNS_SUBDOMAIN_CODE
fi
fi
fi
if [ ! $DOMAIN_NAME ]; then