Commit 208ef43f authored by Praveen Arimbrathodiyil's avatar Praveen Arimbrathodiyil
Browse files

update config in case value changed

parent ca811126
......@@ -59,7 +59,29 @@ case "$1" in
cp ${diaspora_conf_example} ${diaspora_conf_private}
dbc_go diaspora-common "$@"
cp -a -f ${diaspora_conf_private} ${diaspora_conf_private}.tmp
# Read from debconf db
db_get diaspora-common/ssl
diaspora_https=$RET
db_get diaspora-common/letsencrypt
diaspora_letsencrypt=$RET
# If the admin deleted or commented some variables but then set
# them via debconf, (re-)add them to the conffile.
test -z "$SERVERNAME" || grep -Eq '^ *SERVERNAME=' ${diaspora_conf_private} || \
echo "SERVERNAME=" >> ${diaspora_conf_private}
test -z "$diaspora_https" || grep -Eq '^ *diaspora_https=' ${diaspora_conf_private} || \
echo "diaspora_https=" >> ${diaspora_conf_private}
test -z "$diaspora_letsencrypt" || grep -Eq '^ *diaspora_letsencrypt=' ${diaspora_conf_private} || \
echo "diaspora_letsencrypt=" >> ${diaspora_conf_private}
sed -e "s/^ *SERVERNAME=.*/SERVERNAME=\"$SERVERNAME\"/" \
-e "s/^ *diaspora_https=.*/diaspora_https=\"$diaspora_https\"/" \
-e "s/^ *diaspora_letsencrypt=.*/diaspora_letsencrypt=\"$diaspora_letsencrypt\"/" \
< ${diaspora_conf_private} > ${diaspora_conf_private}.tmp
mv -f ${diaspora_conf_private}.tmp ${diaspora_conf_private}
# Configure pod address.
db_get diaspora-common/url
export SERVERNAME=${RET}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment