Moving back to using freedns codes

This commit is contained in:
Bob Mottram 2015-02-15 12:47:10 +00:00
parent a99aaab878
commit ac81c37bf4
2 changed files with 197 additions and 32 deletions

View File

@ -130,26 +130,31 @@ MEDIAGOBLIN_ADMIN_PASSWORD=
# Domain name for microblog installation # Domain name for microblog installation
MICROBLOG_DOMAIN_NAME= MICROBLOG_DOMAIN_NAME=
MICROBLOG_CODE=
MICROBLOG_REPO="git://gitorious.org/social/mainline.git" MICROBLOG_REPO="git://gitorious.org/social/mainline.git"
MICROBLOG_ADMIN_PASSWORD= MICROBLOG_ADMIN_PASSWORD=
# Domain name or redmatrix installation # Domain name or redmatrix installation
REDMATRIX_DOMAIN_NAME= REDMATRIX_DOMAIN_NAME=
REDMATRIX_CODE=
REDMATRIX_REPO="https://github.com/friendica/red.git" REDMATRIX_REPO="https://github.com/friendica/red.git"
REDMATRIX_ADDONS_REPO="https://github.com/friendica/red-addons.git" REDMATRIX_ADDONS_REPO="https://github.com/friendica/red-addons.git"
REDMATRIX_ADMIN_PASSWORD= REDMATRIX_ADMIN_PASSWORD=
# Domain name for Owncloud installation # Domain name for Owncloud installation
OWNCLOUD_DOMAIN_NAME= OWNCLOUD_DOMAIN_NAME=
OWNCLOUD_CODE=
OWNCLOUD_ADMIN_PASSWORD= OWNCLOUD_ADMIN_PASSWORD=
# Domain name for your wiki # Domain name for your wiki
WIKI_DOMAIN_NAME= WIKI_DOMAIN_NAME=
WIKI_ADMIN_PASSWORD= WIKI_ADMIN_PASSWORD=
WIKI_TITLE="Freedombone Wiki" WIKI_TITLE="Freedombone Wiki"
WIKI_CODE=
# Domain name for your blog # Domain name for your blog
FULLBLOG_DOMAIN_NAME= FULLBLOG_DOMAIN_NAME=
FULLBLOG_CODE=
MY_BLOG_TITLE="My Blog" MY_BLOG_TITLE="My Blog"
MY_BLOG_SUBTITLE="Another Freedombone Blog" MY_BLOG_SUBTITLE="Another Freedombone Blog"
@ -803,18 +808,33 @@ function read_configuration {
if grep -q "MICROBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then if grep -q "MICROBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then
MICROBLOG_DOMAIN_NAME=$(grep "MICROBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') MICROBLOG_DOMAIN_NAME=$(grep "MICROBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
if grep -q "MICROBLOG_CODE" $CONFIGURATION_FILE; then
MICROBLOG_CODE=$(grep "MICROBLOG_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "REDMATRIX_DOMAIN_NAME" $CONFIGURATION_FILE; then if grep -q "REDMATRIX_DOMAIN_NAME" $CONFIGURATION_FILE; then
REDMATRIX_DOMAIN_NAME=$(grep "REDMATRIX_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') REDMATRIX_DOMAIN_NAME=$(grep "REDMATRIX_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
if grep -q "REDMATRIX_CODE" $CONFIGURATION_FILE; then
REDMATRIX_CODE=$(grep "REDMATRIX_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "OWNCLOUD_DOMAIN_NAME" $CONFIGURATION_FILE; then if grep -q "OWNCLOUD_DOMAIN_NAME" $CONFIGURATION_FILE; then
OWNCLOUD_DOMAIN_NAME=$(grep "OWNCLOUD_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') OWNCLOUD_DOMAIN_NAME=$(grep "OWNCLOUD_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
if grep -q "OWNCLOUD_CODE" $CONFIGURATION_FILE; then
OWNCLOUD_CODE=$(grep "OWNCLOUD_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE; then if grep -q "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE; then
WIKI_DOMAIN_NAME=$(grep "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') WIKI_DOMAIN_NAME=$(grep "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
if grep -q "WIKI_CODE" $CONFIGURATION_FILE; then
WIKI_CODE=$(grep "WIKI_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then if grep -q "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then
FULLBLOG_DOMAIN_NAME=$(grep "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') FULLBLOG_DOMAIN_NAME=$(grep "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
if grep -q "FULLBLOG_CODE" $CONFIGURATION_FILE; then
FULLBLOG_CODE=$(grep "FULLBLOG_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "MY_BLOG_TITLE" $CONFIGURATION_FILE; then if grep -q "MY_BLOG_TITLE" $CONFIGURATION_FILE; then
MY_BLOG_TITLE=$(grep "MY_BLOG_TITLE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') MY_BLOG_TITLE=$(grep "MY_BLOG_TITLE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi

View File

@ -69,11 +69,16 @@ NAMESERVER1=
NAMESERVER2= NAMESERVER2=
WIKI_TITLE= WIKI_TITLE=
WIKI_DOMAIN_NAME= WIKI_DOMAIN_NAME=
WIKI_CODE=
MY_BLOG_TITLE= MY_BLOG_TITLE=
FULLBLOG_DOMAIN_NAME= FULLBLOG_DOMAIN_NAME=
FULLBLOG_CODE=
OWNCLOUD_DOMAIN_NAME= OWNCLOUD_DOMAIN_NAME=
OWNCLOUD_CODE=
REDMATRIX_DOMAIN_NAME= REDMATRIX_DOMAIN_NAME=
REDMATRIX_CODE=
MICROBLOG_DOMAIN_NAME= MICROBLOG_DOMAIN_NAME=
MICROBLOG_CODE=
CONFIGURATION_FILE= CONFIGURATION_FILE=
@ -157,21 +162,36 @@ function save_configuration_file {
if [ $WIKI_DOMAIN_NAME ]; then if [ $WIKI_DOMAIN_NAME ]; then
echo "WIKI_DOMAIN_NAME=$WIKI_DOMAIN_NAME" >> $CONFIGURATION_FILE echo "WIKI_DOMAIN_NAME=$WIKI_DOMAIN_NAME" >> $CONFIGURATION_FILE
fi fi
if [ $WIKI_CODE ]; then
echo "WIKI_CODE=$WIKI_CODE" >> $CONFIGURATION_FILE
fi
if [ $MY_BLOG_TITLE ]; then if [ $MY_BLOG_TITLE ]; then
echo "MY_BLOG_TITLE=$MY_BLOG_TITLE" >> $CONFIGURATION_FILE echo "MY_BLOG_TITLE=$MY_BLOG_TITLE" >> $CONFIGURATION_FILE
fi fi
if [ $FULLBLOG_DOMAIN_NAME ]; then if [ $FULLBLOG_DOMAIN_NAME ]; then
echo "FULLBLOG_DOMAIN_NAME=$FULLBLOG_DOMAIN_NAME" >> $CONFIGURATION_FILE echo "FULLBLOG_DOMAIN_NAME=$FULLBLOG_DOMAIN_NAME" >> $CONFIGURATION_FILE
fi fi
if [ $FULLBLOG_CODE ]; then
echo "FULLBLOG_CODE=$FULLBLOG_CODE" >> $CONFIGURATION_FILE
fi
if [ $OWNCLOUD_DOMAIN_NAME ]; then if [ $OWNCLOUD_DOMAIN_NAME ]; then
echo "OWNCLOUD_DOMAIN_NAME=$OWNCLOUD_DOMAIN_NAME" >> $CONFIGURATION_FILE echo "OWNCLOUD_DOMAIN_NAME=$OWNCLOUD_DOMAIN_NAME" >> $CONFIGURATION_FILE
fi fi
if [ $OWNCLOUD_CODE ]; then
echo "OWNCLOUD_CODE=$OWNCLOUD_CODE" >> $CONFIGURATION_FILE
fi
if [ $REDMATRIX_DOMAIN_NAME ]; then if [ $REDMATRIX_DOMAIN_NAME ]; then
echo "REDMATRIX_DOMAIN_NAME=$REDMATRIX_DOMAIN_NAME" >> $CONFIGURATION_FILE echo "REDMATRIX_DOMAIN_NAME=$REDMATRIX_DOMAIN_NAME" >> $CONFIGURATION_FILE
fi fi
if [ $REDMATRIX_CODE ]; then
echo "REDMATRIX_CODE=$REDMATRIX_CODE" >> $CONFIGURATION_FILE
fi
if [ $MICROBLOG_DOMAIN_NAME ]; then if [ $MICROBLOG_DOMAIN_NAME ]; then
echo "MICROBLOG_DOMAIN_NAME=$MICROBLOG_DOMAIN_NAME" >> $CONFIGURATION_FILE echo "MICROBLOG_DOMAIN_NAME=$MICROBLOG_DOMAIN_NAME" >> $CONFIGURATION_FILE
fi fi
if [ $MICROBLOG_CODE ]; then
echo "MICROBLOG_CODE=$MICROBLOG_CODE" >> $CONFIGURATION_FILE
fi
} }
# test a domain name to see if it's valid # test a domain name to see if it's valid
@ -194,6 +214,8 @@ function interactive_configuration {
cp $CONFIGURATION_FILE temp.cfg cp $CONFIGURATION_FILE temp.cfg
fi fi
FREEDNS_MESSAGE="Please enter the FreeDNS code for this domain"
dialog --title "Freedombone" --msgbox "Welcome to the Freedombone interactive installer. Communications freedom is only a short time away.\n\nEnsure that you have your domain and dynamic DNS settings ready.\n\nFor more information please visit $FREEDOMBONE_WEBSITE or send a Bitmessage to $FREEDOMBONE_BITMESSAGE" 15 50 dialog --title "Freedombone" --msgbox "Welcome to the Freedombone interactive installer. Communications freedom is only a short time away.\n\nEnsure that you have your domain and dynamic DNS settings ready.\n\nFor more information please visit $FREEDOMBONE_WEBSITE or send a Bitmessage to $FREEDOMBONE_BITMESSAGE" 15 50
data=$(tempfile 2>/dev/null) data=$(tempfile 2>/dev/null)
@ -585,16 +607,28 @@ function interactive_configuration {
save_configuration_file save_configuration_file
if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_FULL" ]]; then
while [ ! $WIKI_DOMAIN_NAME ] WIKI_DETAILS_COMPLETE=
while [ ! $WIKI_DETAILS_COMPLETE ]
do 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" \
--title "Wiki Configuration" \ if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
--form "\nPlease enter your wiki details:" 11 55 3 \ dialog --backtitle "Freedombone Configuration" \
"Title:" 1 1 "$(grep 'WIKI_TITLE' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 40 \ --title "Wiki Configuration" \
"Domain:" 2 1 "$(grep 'WIKI_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 2 16 25 40 \ --form "\nPlease enter your wiki details:" 11 55 4 \
2> $data "Title:" 1 1 "$(grep 'WIKI_TITLE' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 40 \
"Domain:" 2 1 "$(grep 'WIKI_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 2 16 25 40 \
"Code:" 3 1 "$(grep 'WIKI_CODE' temp.cfg | awk -F '=' '{print $2}')" 3 16 25 40 \
2> $data
else
dialog --backtitle "Freedombone Configuration" \
--title "Wiki Configuration" \
--form "\nPlease enter your wiki details:" 11 55 3 \
"Title:" 1 1 "$(grep 'WIKI_TITLE' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 40 \
"Domain:" 2 1 "$(grep 'WIKI_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 2 16 25 40 \
2> $data
fi
sel=$? sel=$?
case $sel in case $sel in
1) exit 0;; 1) exit 0;;
@ -608,23 +642,45 @@ function interactive_configuration {
if [[ $TEST_DOMAIN_NAME != $WIKI_DOMAIN_NAME ]]; then if [[ $TEST_DOMAIN_NAME != $WIKI_DOMAIN_NAME ]]; then
WIKI_DOMAIN_NAME= WIKI_DOMAIN_NAME=
dialog --title "Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50 dialog --title "Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50
else
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
WIKI_CODE=$(cat $data | sed -n 3p)
if [ ${#WIKI_CODE} -lt 5 ]; then
WIKI_DOMAIN_NAME=
dialog --title "FreeDNS code" --msgbox "$FREEDNS_MESSAGE" 15 50
fi
fi
fi fi
fi fi
if [ $WIKI_DOMAIN_NAME ]; then
WIKI_DETAILS_COMPLETE="yes"
fi
done done
save_configuration_file save_configuration_file
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 ] FULLBLOG_DETAILS_COMPLETE=
while [ ! $FULLBLOG_DETAILS_COMPLETE ]
do 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" \ if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
--title "Blog Configuration" \ dialog --backtitle "Freedombone Configuration" \
--form "\nPlease enter your blog details:" 11 55 3 \ --title "Blog Configuration" \
"Title:" 1 1 "$(grep 'MY_BLOG_TITLE' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \ --form "\nPlease enter your blog details:" 11 55 4 \
"Domain:" 2 1 "$(grep 'FULLBLOG_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 2 16 25 30 \ "Title:" 1 1 "$(grep 'MY_BLOG_TITLE' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \
2> $data "Domain:" 2 1 "$(grep 'FULLBLOG_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 2 16 25 30 \
"Code:" 3 1 "$(grep 'FULLBLOG_CODE' temp.cfg | awk -F '=' '{print $2}')" 3 16 25 30 \
2> $data
else
dialog --backtitle "Freedombone Configuration" \
--title "Blog Configuration" \
--form "\nPlease enter your blog details:" 11 55 3 \
"Title:" 1 1 "$(grep 'MY_BLOG_TITLE' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \
"Domain:" 2 1 "$(grep 'FULLBLOG_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 2 16 25 30 \
2> $data
fi
sel=$? sel=$?
case $sel in case $sel in
1) exit 0;; 1) exit 0;;
@ -641,22 +697,43 @@ function interactive_configuration {
if [[ $TEST_DOMAIN_NAME != $FULLBLOG_DOMAIN_NAME ]]; then if [[ $TEST_DOMAIN_NAME != $FULLBLOG_DOMAIN_NAME ]]; then
FULLBLOG_DOMAIN_NAME= FULLBLOG_DOMAIN_NAME=
dialog --title "Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50 dialog --title "Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50
else
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
FULLBLOG_CODE=$(cat $data | sed -n 3p)
if [ ${#FULLBLOG_CODE} -lt 5 ]; then
FULLBLOG_DOMAIN_NAME=
dialog --title "FreeDNS code" --msgbox "$FREEDNS_MESSAGE" 15 50
fi
fi
fi fi
fi fi
if [ $FULLBLOG_DOMAIN_NAME ]; then
FULLBLOG_DETAILS_COMPLETE="yes"
fi
done done
save_configuration_file save_configuration_file
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 ] OWNCLOUD_DETAILS_COMPLETE=
while [ ! $OWNCLOUD_DETAILS_COMPLETE ]
do 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" \ if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
--title "Owncloud Configuration" \ dialog --backtitle "Freedombone Configuration" \
--form "\nPlease enter your Owncloud details:" 11 55 3 \ --title "Owncloud Configuration" \
"Domain:" 1 1 "$(grep 'OWNCLOUD_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \ --form "\nPlease enter your Owncloud details:" 11 55 3 \
2> $data "Domain:" 1 1 "$(grep 'OWNCLOUD_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \
"Code:" 2 1 "$(grep 'OWNCLOUD_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 16 25 30 \
2> $data
else
dialog --backtitle "Freedombone Configuration" \
--title "Owncloud Configuration" \
--form "\nPlease enter your Owncloud details:" 11 55 3 \
"Domain:" 1 1 "$(grep 'OWNCLOUD_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \
2> $data
fi
sel=$? sel=$?
case $sel in case $sel in
1) exit 0;; 1) exit 0;;
@ -669,22 +746,43 @@ function interactive_configuration {
if [[ $TEST_DOMAIN_NAME != $OWNCLOUD_DOMAIN_NAME ]]; then if [[ $TEST_DOMAIN_NAME != $OWNCLOUD_DOMAIN_NAME ]]; then
OWNCLOUD_DOMAIN_NAME= OWNCLOUD_DOMAIN_NAME=
dialog --title "Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50 dialog --title "Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50
else
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
OWNCLOUD_CODE=$(cat $data | sed -n 2p)
if [ ${#OWNCLOUD_CODE} -lt 5 ]; then
OWNCLOUD_DOMAIN_NAME=
dialog --title "FreeDNS code" --msgbox "$FREEDNS_MESSAGE" 15 50
fi
fi
fi fi
fi fi
if [ $OWNCLOUD_DOMAIN_NAME ]; then
OWNCLOUD_DETAILS_COMPLETE="yes"
fi
done done
save_configuration_file save_configuration_file
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 ] REDMATRIX_DETAILS_COMPLETE=
while [ ! $REDMATRIX_DETAILS_COMPLETE ]
do 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" \ if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
--title "RedMatrix Configuration" \ dialog --backtitle "Freedombone Configuration" \
--form "\nPlease enter your RedMatrix details:" 11 55 3 \ --title "RedMatrix Configuration" \
"Domain:" 1 1 "$(grep 'REDMATRIX_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \ --form "\nPlease enter your RedMatrix details:" 11 55 3 \
2> $data "Domain:" 1 1 "$(grep 'REDMATRIX_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \
"Code:" 2 1 "$(grep 'REDMATRIX_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 16 25 30 \
2> $data
else
dialog --backtitle "Freedombone Configuration" \
--title "RedMatrix Configuration" \
--form "\nPlease enter your RedMatrix details:" 11 55 3 \
"Domain:" 1 1 "$(grep 'REDMATRIX_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \
2> $data
fi
sel=$? sel=$?
case $sel in case $sel in
1) exit 0;; 1) exit 0;;
@ -697,22 +795,43 @@ function interactive_configuration {
if [[ $TEST_DOMAIN_NAME != $REDMATRIX_DOMAIN_NAME ]]; then if [[ $TEST_DOMAIN_NAME != $REDMATRIX_DOMAIN_NAME ]]; then
REDMATRIX_DOMAIN_NAME= REDMATRIX_DOMAIN_NAME=
dialog --title "Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50 dialog --title "Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50
else
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
REDMATRIX_CODE=$(cat $data | sed -n 2p)
if [ ${#REDMATRIX_CODE} -lt 5 ]; then
REDMATRIX_DOMAIN_NAME=
dialog --title "FreeDNS code" --msgbox "$FREEDNS_MESSAGE" 15 50
fi
fi
fi fi
fi fi
if [ $REDMATRIX_DOMAIN_NAME ]; then
REDMATRIX_DETAILS_COMPLETE="yes"
fi
done done
save_configuration_file save_configuration_file
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 ] MICROBLOG_DETAILS_COMPLETE=
while [ ! $MICROBLOG_DETAILS_COMPLETE ]
do 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" \ if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
--title "Microblog Configuration" \ dialog --backtitle "Freedombone Configuration" \
--form "\nPlease enter your Microblog details:" 11 55 3 \ --title "Microblog Configuration" \
"Domain:" 1 1 "$(grep 'MICROBLOG_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \ --form "\nPlease enter your Microblog details:" 11 55 3 \
2> $data "Domain:" 1 1 "$(grep 'MICROBLOG_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \
"Code:" 2 1 "$(grep 'MICROBLOG_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 16 25 30 \
2> $data
else
dialog --backtitle "Freedombone Configuration" \
--title "Microblog Configuration" \
--form "\nPlease enter your Microblog details:" 11 55 3 \
"Domain:" 1 1 "$(grep 'MICROBLOG_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \
2> $data
fi
sel=$? sel=$?
case $sel in case $sel in
1) exit 0;; 1) exit 0;;
@ -728,8 +847,19 @@ function interactive_configuration {
if [[ $TEST_DOMAIN_NAME != $MICROBLOG_DOMAIN_NAME ]]; then if [[ $TEST_DOMAIN_NAME != $MICROBLOG_DOMAIN_NAME ]]; then
MICROBLOG_DOMAIN_NAME= MICROBLOG_DOMAIN_NAME=
dialog --title "Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50 dialog --title "Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50
else
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
MICROBLOG_CODE=$(cat $data | sed -n 2p)
if [ ${#MICROBLOG_CODE} -lt 5 ]; then
MICROBLOG_DOMAIN_NAME=
dialog --title "FreeDNS code" --msgbox "$FREEDNS_MESSAGE" 15 50
fi
fi
fi fi
fi fi
if [ $MICROBLOG_DOMAIN_NAME ]; then
MICROBLOG_DETAILS_COMPLETE="yes"
fi
done done
save_configuration_file save_configuration_file
fi fi
@ -851,18 +981,33 @@ function read_configuration {
if grep -q "MICROBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then if grep -q "MICROBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then
MICROBLOG_DOMAIN_NAME=$(grep "MICROBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') MICROBLOG_DOMAIN_NAME=$(grep "MICROBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
if grep -q "MICROBLOG_CODE" $CONFIGURATION_FILE; then
MICROBLOG_CODE=$(grep "MICROBLOG_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "REDMATRIX_DOMAIN_NAME" $CONFIGURATION_FILE; then if grep -q "REDMATRIX_DOMAIN_NAME" $CONFIGURATION_FILE; then
REDMATRIX_DOMAIN_NAME=$(grep "REDMATRIX_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') REDMATRIX_DOMAIN_NAME=$(grep "REDMATRIX_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
if grep -q "REDMATRIX_CODE" $CONFIGURATION_FILE; then
REDMATRIX_CODE=$(grep "REDMATRIX_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "OWNCLOUD_DOMAIN_NAME" $CONFIGURATION_FILE; then if grep -q "OWNCLOUD_DOMAIN_NAME" $CONFIGURATION_FILE; then
OWNCLOUD_DOMAIN_NAME=$(grep "OWNCLOUD_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') OWNCLOUD_DOMAIN_NAME=$(grep "OWNCLOUD_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
if grep -q "OWNCLOUD_CODE" $CONFIGURATION_FILE; then
OWNCLOUD_CODE=$(grep "OWNCLOUD_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE; then if grep -q "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE; then
WIKI_DOMAIN_NAME=$(grep "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') WIKI_DOMAIN_NAME=$(grep "WIKI_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
if grep -q "WIKI_CODE" $CONFIGURATION_FILE; then
WIKI_CODE=$(grep "WIKI_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then if grep -q "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE; then
FULLBLOG_DOMAIN_NAME=$(grep "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}') FULLBLOG_DOMAIN_NAME=$(grep "FULLBLOG_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
if grep -q "FULLBLOG_CODE" $CONFIGURATION_FILE; then
FULLBLOG_CODE=$(grep "FULLBLOG_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "MY_BLOG_TITLE" $CONFIGURATION_FILE; then if grep -q "MY_BLOG_TITLE" $CONFIGURATION_FILE; then
MY_BLOG_TITLE=$(grep "MY_BLOG_TITLE" $CONFIGURATION_FILE | awk -F '=' '{print $2}') MY_BLOG_TITLE=$(grep "MY_BLOG_TITLE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi