#!/bin/sh jail="$1" if [ -z "$jail" ]; then echo "=== Host: $HOST" else echo echo "=== Jail: $jail" fi freebsd-update fetch install portsnap fetch update portmaster -av rm -rv /boot/*old /usr/ports/distfiles/* pkg autoremove if [ -n "$jail" ]; then exit fi jails=`jls -N | awk 'BEGIN { OUT=""; } {if (!/JID/) { OUT=OUT" "$1; }} END { print OUT; }'` for jail in $jails; do jtmpfile=`jexec "$jail" mktemp` || continue dd if="$0" status=none | jexec "$jail" dd of="$jtmpfile" status=none || continue jexec "$jail" chmod 0700 "$jtmpfile" || continue jexec "$jail" "$jtmpfile" "$jail" jexec "$jail" rm "$jtmpfile" done