Files
VPS-scripts_Web-V2/CoreModules/nginx/phpupdate-handeler.sh
Bram Prieshof 652b69ec37 Fixed oopsie
2020-08-14 14:52:18 +02:00

24 lines
803 B
Bash

for f in /etc/nginx/sites-available/*; do
if [ $IMODE = n ] && [ $PhpPurge = 0 ]; then
if (whiptail --title "Update Nginx config ?" --yesno "Update php version in nginx 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 nginx 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 nginx