[Jail Update] Use jls now for finding jails
This commit is contained in:
parent
a330e46647
commit
dcaf20173c
@ -1,32 +1,33 @@
|
|||||||
#!/bin/csh
|
#!/bin/csh
|
||||||
|
|
||||||
# Upgrade host packages
|
# upgrade host packages
|
||||||
echo ""
|
echo ""
|
||||||
echo "############ UPGRADE HOST PACKAGES ############"
|
echo "############ UPGRADE HOST PACKAGES ############"
|
||||||
echo ""
|
echo ""
|
||||||
pkg update && \
|
pkg update
|
||||||
pkg upgrade -y && \
|
pkg upgrade -y
|
||||||
pkg clean -ya
|
pkg clean -ya
|
||||||
|
|
||||||
# Upgrade jail packages
|
# upgrade jail packages
|
||||||
echo ""
|
echo ""
|
||||||
echo "############ UPGRADE JAIL PACKAGES ############"
|
echo "############ UPGRADE JAIL PACKAGES ############"
|
||||||
foreach jail (`ls /usr/jails | \
|
foreach jailid (`/usr/sbin/jls jid`)
|
||||||
grep -v basejail | \
|
|
||||||
grep -v ezjail_archives | \
|
|
||||||
grep -v flavours | \
|
|
||||||
grep -v newjail | \
|
|
||||||
grep -v fulljail`)
|
|
||||||
|
|
||||||
|
# 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 ""
|
||||||
echo "Updating $jail"
|
echo "Updating $jailname"
|
||||||
pkg -j $jail update && \
|
pkg -j $jailid update
|
||||||
pkg -j $jail upgrade -y && \
|
pkg -j $jailid upgrade -y
|
||||||
pkg -j $jail clean -ay
|
pkg -j $jailid clean -ay
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Report done
|
# report done
|
||||||
echo ""
|
echo ""
|
||||||
echo "############### ALL DONE THANKS ###############"
|
echo "############### ALL DONE THANKS ###############"
|
||||||
echo ""
|
echo ""
|
Loading…
Reference in New Issue
Block a user