summaryrefslogtreecommitdiffstats
path: root/satellit_upgrader/updater.template.sh
diff options
context:
space:
mode:
authorSimon Rettberg2016-09-09 19:41:14 +0200
committerSimon Rettberg2016-09-09 19:41:14 +0200
commit62ad4e23182210554e108a820fbdffdd31cb6ec4 (patch)
tree26e18cc82b31e50fec463ef59c1904612211ef58 /satellit_upgrader/updater.template.sh
parent[SSUS] Fix minor issues with tmate install (diff)
downloadsetup-scripts-62ad4e23182210554e108a820fbdffdd31cb6ec4.tar.gz
setup-scripts-62ad4e23182210554e108a820fbdffdd31cb6ec4.tar.xz
setup-scripts-62ad4e23182210554e108a820fbdffdd31cb6ec4.zip
[SSUS] Patch max upload filesize in php.ini
Diffstat (limited to 'satellit_upgrader/updater.template.sh')
-rw-r--r--satellit_upgrader/updater.template.sh28
1 files changed, 25 insertions, 3 deletions
diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh
index 93e6067..7476232 100644
--- a/satellit_upgrader/updater.template.sh
+++ b/satellit_upgrader/updater.template.sh
@@ -287,14 +287,33 @@ if [ -n "$TGZ_TFTP" ]; then
echo "TFTP upgrade complete"
fi
+RESTART_LIGHTY=
# ********************** lighttpd config *******************
if [ -e "$FILEDIR/lighttpd.conf" ] && [ -e "/etc/lighttpd/lighttpd.conf" ]; then
echo "* Replacing lighttpd.conf"
cp "$FILEDIR/lighttpd.conf" "/etc/lighttpd/lighttpd.conf" || perror "Could not replace /etc/lighttpd/lighttpd.conf"
- restart_service lighttpd
+ RESTART_LIGHTY=ja
echo "lighttpd config upgrade complete"
fi
+# ************************** PHP ***************************
+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)"
+ else
+ echo "upload_max_filesize = 100M" >> "$PHPINIFILE" || pwarning "Could not incease PHP upload limit :( (2)"
+ fi
+ RESTART_LIGHTY=ja
+fi
+
+# **
+if [ -n "$RESTART_LIGHTY" ]; then
+ echo "* Restarting lighttpd"
+ restart_service lighttpd
+fi
+
# ********************** atftpd.service ********************
if [ -e "$FILEDIR/atftpd.service" ]; then
echo "* Replacing atftpd.service"
@@ -338,17 +357,20 @@ fi
# ************************** tmate ************************
if ! which tmate > /dev/null 2>&1; then
- echo "* tmate"
+ echo "* Installing tmate"
echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/10-added_repos.list
+ echo "Running apt update..."
if ! apt-get update > "$TMPDIR/apt.log" 2>&1; then
cat "$TMPDIR/apt.log"
pwarning "Adding backborts repo: update failed"
fi
+ echo "Installing package..."
if ! apt-get install -y tmate > "$TMPDIR/apt.log" 2>&1; then
cat "$TMPDIR/apt.log"
pwarning "Could not install tmate. Easy remote assistance will not be available."
pwarning "Please check whether repo 'jessie-backports' was added and install by hand."
fi
+ echo "Writing config..."
cat > /root/.tmate.conf <<-JUSTANOTHERDOC
set -g tmate-server-host "tmate.ruf.uni-freiburg.de"
set -g tmate-server-port 2222
@@ -358,7 +380,7 @@ if ! which tmate > /dev/null 2>&1; then
JUSTANOTHERDOC
if which tmate > /dev/null 2>&1; then
- echo "tmate installation complete"
+ echo "tmate installation complete!"
fi
fi