# Copyright (c) 2018-2020, diyIT.org # All rights reserved. # # BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License") # https://diyit.org/license/ # # #!/bin/bash #pkg-repo pj121 web_jails=(cloud hub nivi rishabh sharad web web-diyit ldap-mgr r-ldap-mgr monitor) #<<'COMMENT-SKIP-PKG-BUILD' iocage exec pkgp "pkg update -f" iocage exec pkgp "pkg upgrade -y" iocage exec pkgp "pkg clean -ay" iocage set securelevel=0 pkgp iocage exec pkgp "poudriere jail -l" iocage exec pkgp "poudriere jail -u -j pj121" iocage set securelevel=2 pkgp iocage exec pkgp "portsnap auto" iocage exec pkgp "poudriere ports -l" iocage exec pkgp "poudriere ports -u" iocage exec pkgp "poudriere bulk -f /mnt/config/mypkgs -j pj121" #COMMENT-SKIP-PKG-BUILD cd /mnt/ship/ldap/phpLDAPadmin git pull cd /mnt/ship/r-ldap/phpLDAPadmin git pull cd /mnt/ship/book/calibre-web git pull cd /mnt/ship/plex/PlexConnect git pull cd /mnt/ship/maps/networkmaps git pull # cert - acme.sh echo Return/Enter to continue, ctrl-c to abort? read RESP for i in `iocage list -h | cut -f 2`; do echo "## $i JAIL ##" iocage exec $i "pkg update -f" if [[ "$i" == "ldap" || "$i" == "r-ldap" ]]; then iocage exec $i "pkg unlock -y openldap-sasl-server" iocage exec $i "pkg unlock -y openldap-sasl-client" iocage exec $i "pkg upgrade -y -r pkgp121 openldap-sasl-server openldap-sasl-client" iocage exec $i "pkg lock -y openldap-sasl-server" iocage exec $i "pkg lock -y openldap-sasl-client" fi if [[ "$i" == "atm" || "$i" == "hub" || "$i" == "mail" || "$i" == "web" ]]; then iocage exec $i "pkg unlock -y openldap-sasl-client" iocage exec $i "pkg upgrade -y -r pkgp121 openldap-sasl-client" iocage exec $i "pkg lock -y openldap-sasl-client" fi iocage exec $i "pkg autoremove -y" iocage exec $i "pkg upgrade -y" iocage exec $i "pkg clean -ay" echo "####" #echo continue? #read RESP done for i in ${web_jails[@]}; do 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 echo NOTES: echo pkg update -f echo pkg autoremove -y echo pkg upgrade -y echo pkg clean -ay echo iocage stop ALL echo iocage start ALL echo hub check for index.html and adminer version echo iocage exec cert "/root/.acme.sh/acme.sh --upgrade" echo iocage exec cert "cp -r /root/.acme.sh /mnt/certs"