#!/usr/local/bin/bash # Copyright (c) 2018-2021, diyIT.org # All rights reserved. # # BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License") # https://diyit.org/license/ # # pkg_jail="pj123" pkg_repo="pkgp123" if [[ $1 == "pkgp-skip" ]]; then echo "skipping pkgp update" else iocage exec pkgp "pkg update" iocage exec pkgp "pkg upgrade -y" iocage exec pkgp "pkg clean -ay" #poudriere freebsd-update is failing in jails # iocage set securelevel=0 pkgp # iocage exec pkgp "poudriere jail -u -j $pkg_jail" # iocage set securelevel=2 pkgp iocage exec pkgp "poudriere jail -i -j $pkg_jail" portsnap auto iocage exec pkgp "portsnap auto" iocage exec pkgp "poudriere ports -l" iocage exec pkgp "poudriere bulk -f /mnt/config/mypkgs -j $pkg_jail" fi if [[ $1 == "pkgp-only" ]]; then exit fi read -p "Return/Enter to continue, ctrl-c to abort? " RESP #for i in `iocage list -h | cut -f 2`; for i in `jls -N | cut -d " " -f 2 | cut -d "-" -f 2- | grep -v JID | sort`; do echo "######## ## JAIL:::: $i ##" if [[ $i == "pkgp" || $i == "debian" ]]; then continue fi iocage exec $i "pkg update" if [[ $i == "ldap" || $i == "r-ldap" ]]; then iocage exec $i "pkg unlock -y openldap24-server" iocage exec $i "pkg unlock -y openldap24-client" iocage exec $i "pkg upgrade -y -r $pkg_repo openldap24-server openldap24-client" iocage exec $i "pkg lock -y openldap24-server" iocage exec $i "pkg lock -y openldap24-client" fi if [[ $i == "atm" || $i == "book" || $i == "hub" || $i == "mail" || $i == "web" ]]; then iocage exec $i "pkg unlock -y openldap24-client" iocage exec $i "pkg upgrade -y -r $pkg_repo openldap24-client" iocage exec $i "pkg lock -y openldap24-client" fi iocage exec $i "pkg autoremove -y" iocage exec $i "pkg upgrade -y" iocage exec $i "pkg clean -ay" iocage exec $i "pkg query -e "%a==0" "%n" | sort -d | xargs | tee /mnt/config/pkg-list.txt" iocage exec $i "pkg query -e "%a==0" "%R____%n-%v" | sort -d | tee /mnt/config/pkg-list-details.txt" echo "######## ####" # read -p "continue, ctrl-c to abort? " RESP done pkg query -e "%a==0" "%n" | sort -d | xargs | tee /root/FreeBSD/jails/pkg-list-server.txt pkg query -e "%a==0" "%R____%n-%v" | sort -d | tee /root/FreeBSD/jails/pkg-list-details-server.txt cd /mnt/ship/book/calibre-web pwd git pull cd /mnt/ship/plex/PlexConnect pwd git pull cd /mnt/ship/maps/networkmaps pwd git pull echo "NOTES:" echo "" echo "update base system by running:" echo "pkg update" echo "pkg autoremove -y" echo "pkg upgrade -y" echo "pkg clean -ay" echo "" echo "# iocage stop ALL" echo "# iocage start ALL" echo "iocage restart -s ALL" echo "" echo "check hub for index.html and adminer version" echo "" echo "iocage exec cert \"/root/.acme.sh/acme.sh --upgrade\"" echo "iocage exec cert \"/mnt/config/backup.sh\"" echo "" echo "iocage exec hass \"/mnt/config/hass-upgrade.sh\""