diff options
author | Simon Rettberg | 2017-01-16 15:30:59 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-01-16 15:30:59 +0100 |
commit | 4955b27a6150c8dd2136951413a69ed943d2faff (patch) | |
tree | 5dc0e92c8aec1a2d3db89c71820bf30f93b95ac3 /satellit_upgrader/updater.template.sh | |
parent | [SSUS] Remove check for current webif version; broken anyways (diff) | |
download | setup-scripts-4955b27a6150c8dd2136951413a69ed943d2faff.tar.gz setup-scripts-4955b27a6150c8dd2136951413a69ed943d2faff.tar.xz setup-scripts-4955b27a6150c8dd2136951413a69ed943d2faff.zip |
[SSUS] Check if patch_lighttpd_phpchildren is included before trying to install it
Diffstat (limited to 'satellit_upgrader/updater.template.sh')
-rw-r--r-- | satellit_upgrader/updater.template.sh | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 5f02736..09721ca 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -296,25 +296,23 @@ if [ -e "$FILEDIR/lighttpd.conf" ] && [ -e "/etc/lighttpd/lighttpd.conf" ]; then fi # ********************** lighttpd php_children ************* - -echo "* lighttpd: dynamic php children value" -echo -n "Looking for lighttpd service file..." -if [ -f /lib/systemd/system/lighttpd.service ]; then - # service file found, patching dynamic php children value at system start via patchfile - if ! grep -q patch_lighttpd_phpchildren /lib/systemd/system/lighttpd.service; then - echo -n " found. Patching service file ... " - sed -i 's#\[Service\]#\[Service\]\nExecStartPre=\-/usr/local/sbin/patch_lighttpd_phpchildren#g' \ - /lib/systemd/system/lighttpd.service || perror "Could not patch service file!" - cp "$FILEDIR/patch_lighttpd_phpchildren" /usr/local/sbin || perror "Could not copy patch_lighttpd_phpchildren script!" - chmod +x /usr/local/sbin/patch_lighttpd_phpchildren # Just to sleep better in dark nights. - echo " done." - systemctl daemon-reload - RESTART_LIGHTY=ja +if [ -e "$FILEDIR/patch_lighttpd_phpchildren" ]; then + echo "* lighttpd: dynamic php children value" + cp "$FILEDIR/patch_lighttpd_phpchildren" /usr/local/sbin || perror "Could not copy patch_lighttpd_phpchildren script!" + if [ -f "/lib/systemd/system/lighttpd.service" ]; then + # service file found, patching dynamic php children value at system start via patchfile + if ! grep -q patch_lighttpd_phpchildren "/lib/systemd/system/lighttpd.service"; then + echo "Patching service file ... " + sed -i 's#\[Service\]#\[Service\]\nExecStartPre=\-/usr/local/sbin/patch_lighttpd_phpchildren#g' \ + /lib/systemd/system/lighttpd.service || perror "Could not patch service file!" + chmod +x /usr/local/sbin/patch_lighttpd_phpchildren # Just to sleep better in dark nights. + systemctl daemon-reload + RESTART_LIGHTY=ja + fi + echo "Done." else - echo " patch_lighttpd_phpchildren entry already there, doing nothing." + pwarning "lighttpd.service not found. Doing nothing." fi -else - echo " not found. Doing nothing." fi # ************************** PHP *************************** |