From 03773054de720350fb38ef1b64276a48881cb4dc Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Fri, 11 Sep 2020 13:54:08 +0200 Subject: [PATCH] added php update tool for apache --- CoreModules/apache/phpupdate-handeler.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 CoreModules/apache/phpupdate-handeler.sh diff --git a/CoreModules/apache/phpupdate-handeler.sh b/CoreModules/apache/phpupdate-handeler.sh new file mode 100644 index 0000000..8abfe21 --- /dev/null +++ b/CoreModules/apache/phpupdate-handeler.sh @@ -0,0 +1,24 @@ +for f in /etc/apache2/sites-available/*; do + if [ $IMODE = n ] && [ $PhpPurge = 0 ]; then + if (whiptail --title "Update apache config ?" --yesno "Update php version in apache site: ${f##*/} ?" 8 78); then + sed -i "s/$phpver/$newphpver/" $f + fi + fi + if [ $IMODE = l ] && [ $PhpPurge = 0 ]; then + while true; do + read -p "Update php version in apache site: ${f##*/} ? -> yes/no?" yn + case $yn in + [Yy]* ) sed -i "s/$phpver/$newphpver/" $f + break;; + [Nn]* ) echo "" + break;; + * ) echo "Choose yes of no.";; + esac + done + fi + if [ $PhpPurge = 1 ]; then + sed -i "s/$phpver/$newphpver/" $f + fi +done + +systemctl reload apache2 \ No newline at end of file