summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-13 14:00:22 +0100
committerSimon Rettberg2019-02-13 14:00:22 +0100
commita4db1edb5cfdb0f2e27504c7b92d5fd8f84a09ed (patch)
tree15a20dcfbd749987b377ccdd6259823643a503e5
parent[SSUS] Update for new ipxe-aware slx-admin/taskmanager (diff)
downloadsetup-scripts-a4db1edb5cfdb0f2e27504c7b92d5fd8f84a09ed.tar.gz
setup-scripts-a4db1edb5cfdb0f2e27504c7b92d5fd8f84a09ed.tar.xz
setup-scripts-a4db1edb5cfdb0f2e27504c7b92d5fd8f84a09ed.zip
[SSUS] php.ini patching: Look for php5 and php7
-rw-r--r--satellit_upgrader/updater.template.sh37
1 files changed, 22 insertions, 15 deletions
diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh
index 2f34c0c..88f6639 100644
--- a/satellit_upgrader/updater.template.sh
+++ b/satellit_upgrader/updater.template.sh
@@ -428,23 +428,30 @@ fi
# ************************** PHP ***************************
-declare -rg PHPINIFILE=/etc/php5/cgi/php.ini
-if ! grep -q -E '^\s*upload_max_filesize = 100M' "$PHPINIFILE"; then
- echo "PHP: Increasing upload_max_filesize to 100MB"
- 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)"
+inicount=0
+for PHPINIFILE in "/etc/php5/cgi/php.ini" "/etc/php/7.0/cgi/php.ini"; do
+ [ -f "$PHPINIFILE" ] || continue
+ inicount=$(( inicount + 1 ))
+ if ! grep -q -E '^\s*upload_max_filesize = 100M' "$PHPINIFILE"; then
+ echo "PHP: Increasing upload_max_filesize to 100MB"
+ 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
fi
-fi
-if ! grep -q -E '^\s*post_max_size = 100M' "$PHPINIFILE"; then
- echo "PHP: Increasing post_max_size to 100MB"
- 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 "post_max_size = 100M" >> "$PHPINIFILE" || pwarning "Could not incease PHP upload limit :( (2.b)"
+ if ! grep -q -E '^\s*post_max_size = 100M' "$PHPINIFILE"; then
+ echo "PHP: Increasing post_max_size to 100MB"
+ 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 "post_max_size = 100M" >> "$PHPINIFILE" || pwarning "Could not incease PHP upload limit :( (2.b)"
+ fi
+ RESTART_LIGHTY=ja
fi
- RESTART_LIGHTY=ja
+done
+if [ "$inicount" -ne 1 ]; then
+ pwarning "Odd. Found $inicount php.ini files, expected only one..."
fi
echo "* TFTP"