Don't install hubzilla on onion-only variants

This commit is contained in:
Bob Mottram 2016-10-09 18:39:55 +01:00
parent a69afb25b1
commit e8a6d8fdd7
1 changed files with 47 additions and 47 deletions

View File

@ -137,57 +137,57 @@ function configure_interactive_hubzilla {
function install_interactive_hubzilla {
if [[ $ONION_ONLY != "no" ]]; then
HUBZILLA_DOMAIN_NAME='hubzilla.local'
else
HUBZILLA_DETAILS_COMPLETE=
while [ ! $HUBZILLA_DETAILS_COMPLETE ]
do
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
dialog --backtitle $"Freedombone Configuration" \
--title $"Hubzilla Configuration" \
--form $"\nPlease enter your Hubzilla details.\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 14 55 3 \
$"Domain:" 1 1 "$(grep 'HUBZILLA_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 33 40 \
$"Code:" 2 1 "$(grep 'HUBZILLA_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 16 33 255 \
2> $data
return
fi
HUBZILLA_DETAILS_COMPLETE=
while [ ! $HUBZILLA_DETAILS_COMPLETE ]
do
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
dialog --backtitle $"Freedombone Configuration" \
--title $"Hubzilla Configuration" \
--form $"\nPlease enter your Hubzilla details.\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 14 55 3 \
$"Domain:" 1 1 "$(grep 'HUBZILLA_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 33 40 \
$"Code:" 2 1 "$(grep 'HUBZILLA_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 16 33 255 \
2> $data
else
dialog --backtitle $"Freedombone Configuration" \
--title $"Hubzilla Configuration" \
--form $"\nPlease enter your Hubzilla details\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 11 55 3 \
$"Domain:" 1 1 "$(grep 'HUBZILLA_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 33 40 \
2> $data
fi
sel=$?
case $sel in
1) exit 1;;
255) exit 1;;
esac
HUBZILLA_DOMAIN_NAME=$(cat $data | sed -n 1p)
if [ $HUBZILLA_DOMAIN_NAME ]; then
TEST_DOMAIN_NAME=$HUBZILLA_DOMAIN_NAME
validate_domain_name
if [[ $TEST_DOMAIN_NAME != $HUBZILLA_DOMAIN_NAME ]]; then
HUBZILLA_DOMAIN_NAME=
dialog --title $"Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50
else
dialog --backtitle $"Freedombone Configuration" \
--title $"Hubzilla Configuration" \
--form $"\nPlease enter your Hubzilla details\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 11 55 3 \
$"Domain:" 1 1 "$(grep 'HUBZILLA_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 33 40 \
2> $data
fi
sel=$?
case $sel in
1) exit 1;;
255) exit 1;;
esac
HUBZILLA_DOMAIN_NAME=$(cat $data | sed -n 1p)
if [ $HUBZILLA_DOMAIN_NAME ]; then
TEST_DOMAIN_NAME=$HUBZILLA_DOMAIN_NAME
validate_domain_name
if [[ $TEST_DOMAIN_NAME != $HUBZILLA_DOMAIN_NAME ]]; then
HUBZILLA_DOMAIN_NAME=
dialog --title $"Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50
else
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
HUBZILLA_CODE=$(cat $data | sed -n 2p)
validate_freedns_code "$HUBZILLA_CODE"
if [ ! $VALID_CODE ]; then
HUBZILLA_DOMAIN_NAME=
fi
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
HUBZILLA_CODE=$(cat $data | sed -n 2p)
validate_freedns_code "$HUBZILLA_CODE"
if [ ! $VALID_CODE ]; then
HUBZILLA_DOMAIN_NAME=
fi
fi
fi
if [ $HUBZILLA_DOMAIN_NAME ]; then
HUBZILLA_DETAILS_COMPLETE="yes"
fi
done
# save the results in the config file
write_config_param "HUBZILLA_DOMAIN_NAME" "$HUBZILLA_DOMAIN_NAME"
write_config_param "HUBZILLA_CODE" "$HUBZILLA_CODE"
fi
fi
if [ $HUBZILLA_DOMAIN_NAME ]; then
HUBZILLA_DETAILS_COMPLETE="yes"
fi
done
# save the results in the config file
write_config_param "HUBZILLA_DOMAIN_NAME" "$HUBZILLA_DOMAIN_NAME"
write_config_param "HUBZILLA_CODE" "$HUBZILLA_CODE"
}
function change_password_hubzilla {