diff --git a/FreeBSD/jail/jail-update.csh b/FreeBSD/jail/jail-update.csh index 7a978ed..828b640 100644 --- a/FreeBSD/jail/jail-update.csh +++ b/FreeBSD/jail/jail-update.csh @@ -1,32 +1,33 @@ #!/bin/csh -# Upgrade host packages +# upgrade host packages echo "" echo "############ UPGRADE HOST PACKAGES ############" echo "" -pkg update && \ -pkg upgrade -y && \ +pkg update +pkg upgrade -y pkg clean -ya -# Upgrade jail packages +# upgrade jail packages echo "" echo "############ UPGRADE JAIL PACKAGES ############" -foreach jail (`ls /usr/jails | \ - grep -v basejail | \ - grep -v ezjail_archives | \ - grep -v flavours | \ - grep -v newjail | \ - grep -v fulljail`) +foreach jailid (`/usr/sbin/jls jid`) + # get the jailname from the jailid + set jailname = `/usr/sbin/jls jid host.hostname |\ + grep $jailid |\ + cut -d' ' -f2` + + # update the jail packages using jailid but reporitng jailname echo "" - echo "Updating $jail" - pkg -j $jail update && \ - pkg -j $jail upgrade -y && \ - pkg -j $jail clean -ay + echo "Updating $jailname" + pkg -j $jailid update + pkg -j $jailid upgrade -y + pkg -j $jailid clean -ay end -# Report done +# report done echo "" echo "############### ALL DONE THANKS ###############" -echo "" +echo "" \ No newline at end of file