Can specify microblog welcome message during interactive install
This commit is contained in:
parent
674b3f010c
commit
04860eb32c
|
@ -95,6 +95,7 @@ HUBZILLA_DOMAIN_NAME=
|
||||||
HUBZILLA_CODE=
|
HUBZILLA_CODE=
|
||||||
MICROBLOG_DOMAIN_NAME=
|
MICROBLOG_DOMAIN_NAME=
|
||||||
MICROBLOG_CODE=
|
MICROBLOG_CODE=
|
||||||
|
MICROBLOG_WELCOME_MESSAGE=$"<h1>Welcome to \$MICROBLOG_DOMAIN_NAME – a federated microblog</h1><p>Another $PROJECT_NAME site</p>"
|
||||||
GIT_DOMAIN_NAME=
|
GIT_DOMAIN_NAME=
|
||||||
GIT_CODE=
|
GIT_CODE=
|
||||||
MEDIAGOBLIN_DOMAIN_NAME=
|
MEDIAGOBLIN_DOMAIN_NAME=
|
||||||
|
@ -257,6 +258,9 @@ function save_configuration_file {
|
||||||
if [ $MICROBLOG_CODE ]; then
|
if [ $MICROBLOG_CODE ]; then
|
||||||
echo "MICROBLOG_CODE=$MICROBLOG_CODE" >> $CONFIGURATION_FILE
|
echo "MICROBLOG_CODE=$MICROBLOG_CODE" >> $CONFIGURATION_FILE
|
||||||
fi
|
fi
|
||||||
|
if [ $MICROBLOG_WELCOME_MESSAGE ]; then
|
||||||
|
echo "MICROBLOG_WELCOME_MESSAGE=$MICROBLOG_WELCOME_MESSAGE" >> $CONFIGURATION_FILE
|
||||||
|
fi
|
||||||
if [ $GIT_DOMAIN_NAME ]; then
|
if [ $GIT_DOMAIN_NAME ]; then
|
||||||
echo "GIT_DOMAIN_NAME=$GIT_DOMAIN_NAME" >> $CONFIGURATION_FILE
|
echo "GIT_DOMAIN_NAME=$GIT_DOMAIN_NAME" >> $CONFIGURATION_FILE
|
||||||
fi
|
fi
|
||||||
|
@ -1572,15 +1576,17 @@ function interactive_configuration {
|
||||||
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||||
dialog --backtitle $"Freedombone Configuration" \
|
dialog --backtitle $"Freedombone Configuration" \
|
||||||
--title $"Microblog Configuration" \
|
--title $"Microblog Configuration" \
|
||||||
--form $"\nPlease enter your Microblog details\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 11 55 3 \
|
--form $"\nPlease enter your Microblog details\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 14 65 3 \
|
||||||
$"Domain:" 1 1 "$(grep 'MICROBLOG_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \
|
$"Domain:" 1 1 "$(grep 'MICROBLOG_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 20 25 30 \
|
||||||
$"Code:" 2 1 "$(grep 'MICROBLOG_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 16 25 30 \
|
$"Welcome Message:" 2 1 "$(grep '$MICROBLOG_WELCOME_MESSAGE' temp.cfg | awk -F '=' '{print $2}')" 3 20 50 30 \
|
||||||
|
$"Code:" 3 1 "$(grep 'MICROBLOG_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 20 25 30 \
|
||||||
2> $data
|
2> $data
|
||||||
else
|
else
|
||||||
dialog --backtitle $"Freedombone Configuration" \
|
dialog --backtitle $"Freedombone Configuration" \
|
||||||
--title $"Microblog Configuration" \
|
--title $"Microblog Configuration" \
|
||||||
--form $"\nPlease enter your Microblog details\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 11 55 3 \
|
--form $"\nPlease enter your Microblog details\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 13 65 3 \
|
||||||
$"Domain:" 1 1 "$(grep 'MICROBLOG_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 16 25 30 \
|
$"Domain:" 1 1 "$(grep 'MICROBLOG_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 20 25 30 \
|
||||||
|
$"Welcome Message:" 2 1 "$(grep '$MICROBLOG_WELCOME_MESSAGE' temp.cfg | awk -F '=' '{print $2}')" 2 20 50 30 \
|
||||||
2> $data
|
2> $data
|
||||||
fi
|
fi
|
||||||
sel=$?
|
sel=$?
|
||||||
|
@ -1589,6 +1595,10 @@ function interactive_configuration {
|
||||||
255) exit 1;;
|
255) exit 1;;
|
||||||
esac
|
esac
|
||||||
MICROBLOG_DOMAIN_NAME=$(cat $data | sed -n 1p)
|
MICROBLOG_DOMAIN_NAME=$(cat $data | sed -n 1p)
|
||||||
|
welcome_msg=$(cat $data | sed -n 2p)
|
||||||
|
if [ ${#welcome_msg} -gt 1 ]; then
|
||||||
|
MICROBLOG_WELCOME_MESSAGE=$welcome_msg
|
||||||
|
fi
|
||||||
if [ $MICROBLOG_DOMAIN_NAME ]; then
|
if [ $MICROBLOG_DOMAIN_NAME ]; then
|
||||||
if [[ $MICROBLOG_DOMAIN_NAME == "$HUBZILLA_DOMAIN_NAME" ]]; then
|
if [[ $MICROBLOG_DOMAIN_NAME == "$HUBZILLA_DOMAIN_NAME" ]]; then
|
||||||
MICROBLOG_DOMAIN_NAME=""
|
MICROBLOG_DOMAIN_NAME=""
|
||||||
|
@ -1600,7 +1610,7 @@ function interactive_configuration {
|
||||||
dialog --title $"Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50
|
dialog --title $"Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50
|
||||||
else
|
else
|
||||||
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
||||||
MICROBLOG_CODE=$(cat $data | sed -n 2p)
|
MICROBLOG_CODE=$(cat $data | sed -n 3p)
|
||||||
if [ ${#MICROBLOG_CODE} -lt 30 ]; then
|
if [ ${#MICROBLOG_CODE} -lt 30 ]; then
|
||||||
MICROBLOG_DOMAIN_NAME=
|
MICROBLOG_DOMAIN_NAME=
|
||||||
dialog --title $"FreeDNS code" --msgbox "$FREEDNS_MESSAGE" 15 50
|
dialog --title $"FreeDNS code" --msgbox "$FREEDNS_MESSAGE" 15 50
|
||||||
|
@ -1867,6 +1877,9 @@ function read_configuration {
|
||||||
if grep -q "MICROBLOG_CODE" $CONFIGURATION_FILE; then
|
if grep -q "MICROBLOG_CODE" $CONFIGURATION_FILE; then
|
||||||
MICROBLOG_CODE=$(grep "MICROBLOG_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
MICROBLOG_CODE=$(grep "MICROBLOG_CODE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||||
fi
|
fi
|
||||||
|
if grep -q "MICROBLOG_WELCOME_MESSAGE" $CONFIGURATION_FILE; then
|
||||||
|
MICROBLOG_WELCOME_MESSAGE=$(grep "MICROBLOG_WELCOME_MESSAGE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||||
|
fi
|
||||||
if grep -q "HUBZILLA_DOMAIN_NAME" $CONFIGURATION_FILE; then
|
if grep -q "HUBZILLA_DOMAIN_NAME" $CONFIGURATION_FILE; then
|
||||||
HUBZILLA_DOMAIN_NAME=$(grep "HUBZILLA_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
HUBZILLA_DOMAIN_NAME=$(grep "HUBZILLA_DOMAIN_NAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue