From 42f19a019c7beb5ddcdd4f0162d85a66806ee0d8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 7 Jun 2017 13:45:35 +0200 Subject: [SSUS] Confirm update; patch post_max_size; delete dummy coursebackend --- satellit_upgrader/updater.template.sh | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'satellit_upgrader/updater.template.sh') diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index e70a5fc..d534209 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -20,8 +20,10 @@ unset TMPDIR [ -n "$TMPDIR" ] && exit 1 IGNORE_ERRORS= +DO_UPDATE= while [ $# -gt 0 ]; do [ "x$1" = "x--ignore-errors" ] && IGNORE_ERRORS=jup + [ "x$1" = "x--update" ] && DO_UPDATE=pwarning shift done readonly IGNORE_ERRORS @@ -109,10 +111,20 @@ fi # Get current webif version if [ -n "$TGZ_SLXADMIN" ]; then declare -rg CURRENT_WEBIF_VERSION=$(cat "${PATH_SLXADMIN}/version" | tail -n 1) + echo "bwLehrpool Satellite Server Update" + echo -n "Currently installed version: " + sed -r 's/([0-9]{4})([0-9]{3})([0-9]{2})/\1-\2-\3/' <<<"$CURRENT_WEBIF_VERSION" + echo -n "This update package: " + sed -r 's/([0-9]{4})([0-9]{3})([0-9]{2})/\1-\2-\3/' <<<"$TARGET_WEBIF_VERSION" if [ -z "$CURRENT_WEBIF_VERSION" ] || [ "$TARGET_WEBIF_VERSION" = "missing" ] || [ "$CURRENT_WEBIF_VERSION" -le "$TARGET_WEBIF_VERSION" ]; then : # Negate so NaN triggers else branch else - perror "This update seems to be older than the server version you're currently running" + ${DO_UPDATE:-perror} "This update seems to be older than the server version you're currently running" + fi + if [ -z "$DO_UPDATE" ]; then + echo "If you want to install this upate, run again with --update parameter:" + echo "eg. sh $0 --update" + exit 0 fi fi @@ -245,8 +257,8 @@ if [ -n "$TGZ_SLXADMIN" ]; then pwarning "slxadmin updater didn't finish with 'Done.'" fi ) - # Delete old statistics api - rm -f -- "/srv/openslx/www/slx-admin/apis/statistics.inc.php" + # Delete old statistics api, dummy interface for calendar + rm -f -- "/srv/openslx/www/slx-admin/apis/statistics.inc.php" "/srv/openslx/www/slx-admin/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php" fixperms "$PATH_SLXADMIN" root:root chmod 0640 "$PATH_SLXADMIN/config.php" @@ -355,10 +367,15 @@ fi declare -rg PHPINIFILE=/etc/php5/cgi/php.ini if ! grep -q 'upload_max_filesize = 100M' "$PHPINIFILE"; then echo "* Increasing php upload limit" - if grep -q -E "^\s*upload_max_filesize" "$PHPINIFILE"; then - sed -i -e '/^\s*upload_max_filesize/c\upload_max_filesize = 100M' "$PHPINIFILE" || pwarning "Could not increase PHP upload limit :( (1)" + if grep -q -E '^\s*upload_max_filesize' "$PHPINIFILE"; then + sed -i -e '/^\s*upload_max_filesize/c\upload_max_filesize = 100M' "$PHPINIFILE" || pwarning "Could not increase PHP upload limit :( (1.a)" + else + echo "upload_max_filesize = 100M" >> "$PHPINIFILE" || pwarning "Could not incease PHP upload limit :( (2.a)" + fi + if grep -q -E '^\s*post_max_size' "$PHPINIFILE"; then + sed -i -e '/^\s*post_max_size/c\post_max_size = 100M' "$PHPINIFILE" || pwarning "Could not increase PHP upload limit :( (1.b)" else - echo "upload_max_filesize = 100M" >> "$PHPINIFILE" || pwarning "Could not incease PHP upload limit :( (2)" + echo "post_max_size = 100M" >> "$PHPINIFILE" || pwarning "Could not incease PHP upload limit :( (2.b)" fi RESTART_LIGHTY=ja fi -- cgit v1.2.3-55-g7522