FreeBSD/jails/jails-restore-httpd.sh

43 lines
1.3 KiB
Bash
Raw Permalink Normal View History

2020-05-26 21:15:31 -07:00
#!/usr/local/bin/bash
2022-04-19 13:46:35 -07:00
# Copyright (c) 2018-2022, diyIT.org
2020-02-25 11:28:31 -08:00
# All rights reserved.
#
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
# https://diyit.org/license/
#
#
2021-04-01 01:23:14 -07:00
echo "checking pkgp jail nginx instance is running"
iocage exec pkgp "service nginx status"
2022-04-19 13:38:56 -07:00
#all_web_jails=(cloud hub nivi rachna rishabh sharad web web-diyit web-datavpc web-rockwood web-scvcc-rental ldap-mgr r-ldap-mgr monitor)
# fpm jails don't have mod_php installed
web_jails=(ldap-mgr r-ldap-mgr)
2020-02-25 11:28:31 -08:00
for i in ${web_jails[@]};
do
2020-06-11 12:02:40 -07:00
echo ""
echo "## checking $i JAIL configs after Apache and/or PHP updates ##"
iocage exec $i "diff /usr/local/etc/apache24/httpd.conf /mnt/config/httpd.conf"
iocage exec $i "diff /usr/local/etc/php.ini /mnt/config/php.ini"
if [[ "$i" != "ldap-mgr" && "$i" != "r-ldap-mgr" ]]; then
iocage exec $i "diff /usr/local/etc/php-fpm.d/www.conf /mnt/config/www.conf"
fi
echo "####"
done
2020-06-11 12:02:40 -07:00
echo ""
echo "check in output above if php.ini or php-fpm also need to be restored"
echo ""
read -p "Return/Enter to restore httpd.conf files, ctrl-c to abort? " RESP
for i in ${web_jails[@]};
do
2020-06-11 12:02:40 -07:00
echo ""
echo "restoring httpd.conf in web_jail $i after Apache update"
2020-02-25 11:28:31 -08:00
iocage exec $i "cp /mnt/config/httpd.conf /usr/local/etc/apache24/httpd.conf"
2020-05-26 21:15:31 -07:00
iocage exec $i "service apache24 restart"
2020-02-25 11:28:31 -08:00
done