From 561fb2c27c040755ab1590355ec2512fbc5119ac Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 3 May 2017 14:10:17 +0200 Subject: [SSUS/SSPS] Properly install/update autossl and include-conf.d for lighttpd --- satellit_upgrader/updater.template.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'satellit_upgrader/updater.template.sh') diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 4b2da57..d52637c 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -108,7 +108,7 @@ fi # Get current webif version if [ -n "$TGZ_SLXADMIN" ]; then - declare -rg CURRENT_WEBIF_VERSION=$(mysql -e 'SELECT value FROM openslx.property WHERE name = "webif-version" LIMIT 1' | tail -n 1) + declare -rg CURRENT_WEBIF_VERSION=$(cat "${PATH_SLXADMIN}/version" | tail -n 1) if [ -z "$CURRENT_WEBIF_VERSION" ] || [ "$TARGET_WEBIF_VERSION" = "missing" ] || [ "$CURRENT_WEBIF_VERSION" -le "$TARGET_WEBIF_VERSION" ]; then : # Negate so NaN triggers else branch else @@ -202,14 +202,13 @@ if [ -n "$TGZ_SLXADMIN" ]; then FOOTER="$OLDFOOTER [Update: ${FOOTER}]" sed -i "s#^.*define.*CONFIG_FOOTER.*\$#define('CONFIG_FOOTER', '${FOOTER}');#" "${PATH_SLXADMIN}/config.php" grep -q 'CONFIG_FOOTER' "${PATH_SLXADMIN}/config.php" || echo "define('CONFIG_FOOTER', '${FOOTER}');" >> "${PATH_SLXADMIN}/config.php" - grep -q 'CONFIG_REPORTING_URL' "${PATH_SLXADMIN}/config.php" || echo "define('CONFIG_REPORTING_URL', 'https://bwlp-masterserver.ruf.uni-freiburg.de/rpc/');" >> "${PATH_SLXADMIN}/config.php" echo "$TARGET_WEBIF_VERSION" > "${PATH_SLXADMIN}/version" fi # Enable modules ( mkdir -p "$PATH_SLXADMIN/modules" cd "$PATH_SLXADMIN/modules" || perror "Cannot cd to slxadmin" - for mod in adduser backup baseconfig baseconfig_bwidm baseconfig_bwlp bootstrap_datepicker bootstrap_dialog bootstrap_timepicker bootstrap_multiselect bootstrap_switch dozmod eventlog exams js_chart js_circles js_jqueryui js_moment js_selectize js_vis locations main minilinux news serversetup-bwlp roomplanner session statistics summernote sysconfig syslog systemstatus vmstore webinterface; do + for mod in adduser backup baseconfig baseconfig_bwidm baseconfig_bwlp bootstrap_datepicker bootstrap_dialog bootstrap_timepicker bootstrap_multiselect bootstrap_switch dozmod eventlog exams js_chart js_circles js_jqueryui js_moment js_selectize js_stupidtable js_vis locationinfo locations main minilinux news serversetup-bwlp rebootcontrol roomplanner session statistics statistics_reporting summernote sysconfig syslog systemstatus vmstore webinterface; do name=${mod%%-*} rm -f -- "$name" ln -s "../modules-available/$mod" "$name" || pwarning "Could not activate module '$mod' (alias '$name')" @@ -298,6 +297,22 @@ if [ -e "$FILEDIR/lighttpd.conf" ] && [ -e "/etc/lighttpd/lighttpd.conf" ]; then echo "lighttpd config upgrade complete" fi +# ********************** lighttpd auto ssl ******************* +if [ -e "$FILEDIR/lighttpd-auto-ssl.sh" ] && [ -d "/usr/share/lighttpd" ]; then + echo "* Replacing lighttpd auto-ssl.sh" + cp "$FILEDIR/lighttpd-auto-ssl.sh" "/usr/share/lighttpd/auto-ssl.sh" || perror "Could not replace /usr/share/lighttpd/auto-ssl.sh" + RESTART_LIGHTY=ja + echo "lighttpd auto-ssl.sh upgrade complete" +fi + +# ********************** lighttpd-include-conf-d.sh ******************* +if [ -e "$FILEDIR/lighttpd-include-conf-d.sh" ] && [ -d "/usr/share/lighttpd" ]; then + echo "* Replacing lighttpd include-conf-d.sh" + cp "$FILEDIR/lighttpd-include-conf-d.sh" "/usr/share/lighttpd/include-conf-d.sh" || perror "Could not replace /usr/share/lighttpd/include-conf-d.sh" + RESTART_LIGHTY=ja + echo "lighttpd include-conf-d.sh upgrade complete" +fi + # ********************** lighttpd php_children ************* if [ -e "$FILEDIR/patch_lighttpd_phpchildren" ]; then echo "* lighttpd: dynamic php children value" -- cgit v1.2.3-55-g7522