summaryrefslogtreecommitdiffstats
path: root/satellit_upgrader/updater.template.sh
diff options
context:
space:
mode:
authorSimon Rettberg2017-06-07 13:45:35 +0200
committerSimon Rettberg2017-06-07 13:45:35 +0200
commit42f19a019c7beb5ddcdd4f0162d85a66806ee0d8 (patch)
treee9c5f667e3e7de34c74da6a9a858e459dadf6a97 /satellit_upgrader/updater.template.sh
parent[SSPS] Limit max php children to 128 (diff)
downloadsetup-scripts-42f19a019c7beb5ddcdd4f0162d85a66806ee0d8.tar.gz
setup-scripts-42f19a019c7beb5ddcdd4f0162d85a66806ee0d8.tar.xz
setup-scripts-42f19a019c7beb5ddcdd4f0162d85a66806ee0d8.zip
[SSUS] Confirm update; patch post_max_size; delete dummy coursebackend
Diffstat (limited to 'satellit_upgrader/updater.template.sh')
-rw-r--r--satellit_upgrader/updater.template.sh29
1 files changed, 23 insertions, 6 deletions
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