Mediagoblin domain name and code

This commit is contained in:
Bob Mottram 2015-03-25 20:15:33 +00:00
parent a3c2e201da
commit b3bcde5f70
2 changed files with 33 additions and 0 deletions

View File

@ -126,6 +126,7 @@ PRIVATE_MAILING_LIST=
# Domain name for mediagoblin installation
MEDIAGOBLIN_DOMAIN_NAME=
MEDIAGOBLIN_CODE=
MEDIAGOBLIN_REPO="https://gitorious.org/mediagoblin/mediagoblin.git"
MEDIAGOBLIN_ADMIN_PASSWORD=
@ -693,6 +694,12 @@ function read_configuration {
fi
if [ -f $CONFIGURATION_FILE ]; then
if grep -q "MEDIAGOBLIN_DOMAIN_NAME" $CONFIGURATION_FILE; then
MEDIAGOBLIN_DOMAIN_NAME=$(grep "MEDIAGOBLIN_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "MEDIAGOBLIN_CODE" $CONFIGURATION_FILE; then
MEDIAGOBLIN_CODE=$(grep "MEDIAGOBLIN_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "GIT_ADMIN_PASSWORD" $CONFIGURATION_FILE; then
GIT_ADMIN_PASSWORD=$(grep "GIT_ADMIN_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
@ -2825,6 +2832,18 @@ function create_freedns_updater {
echo "$FREEDNS_WGET$MICROBLOG_CODE=" >> /usr/bin/dynamicdns
fi
fi
if [ $GIT_CODE ]; then
if [[ $GIT_CODE != "$DEFAULT_DOMAIN_CODE" ]]; then
echo "# $GIT_DOMAIN_NAME" >> /usr/bin/dynamicdns
echo "$FREEDNS_WGET$GIT_CODE=" >> /usr/bin/dynamicdns
fi
fi
if [ $MEDIAGOBLIN_CODE ]; then
if [[ $MEDIAGOBLIN_CODE != "$DEFAULT_DOMAIN_CODE" ]]; then
echo "# $MEDIAGOBLIN_DOMAIN_NAME" >> /usr/bin/dynamicdns
echo "$FREEDNS_WGET$MEDIAGOBLIN_CODE=" >> /usr/bin/dynamicdns
fi
fi
echo 'exit 0' >> /usr/bin/dynamicdns
chmod 600 /usr/bin/dynamicdns
chmod +x /usr/bin/dynamicdns

View File

@ -82,6 +82,8 @@ MICROBLOG_DOMAIN_NAME=
MICROBLOG_CODE=
GIT_DOMAIN_NAME=
GIT_CODE=
MEDIAGOBLIN_DOMAIN_NAME=
MEDIAGOBLIN_CODE=
USB_DRIVE=/dev/sdb1
CONFIGURATION_FILE=
@ -206,6 +208,12 @@ function save_configuration_file {
if [ $GIT_CODE ]; then
echo "GIT_CODE=$GIT_CODE" >> $CONFIGURATION_FILE
fi
if [ $MEDIAGOBLIN_DOMAIN_NAME ]; then
echo "MEDIAGOBLIN_DOMAIN_NAME=$MEDIAGOBLIN_DOMAIN_NAME" >> $CONFIGURATION_FILE
fi
if [ $MEDIAGOBLIN_CODE ]; then
echo "MEDIAGOBLIN_CODE=$MEDIAGOBLIN_CODE" >> $CONFIGURATION_FILE
fi
}
# test a domain name to see if it's valid
@ -1132,6 +1140,12 @@ function read_configuration {
if grep -q "MY_BLOG_SUBTITLE" $CONFIGURATION_FILE; then
MY_BLOG_SUBTITLE=$(grep "MY_BLOG_SUBTITLE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "MEDIAGOBLIN_DOMAIN_NAME" $CONFIGURATION_FILE; then
MEDIAGOBLIN_DOMAIN_NAME=$(grep "MEDIAGOBLIN_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "MEDIAGOBLIN_CODE" $CONFIGURATION_FILE; then
MEDIAGOBLIN_CODE=$(grep "MEDIAGOBLIN_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
fi
}