Looping Through Jailsby J. Edward Durrett
When working with a large number of Jails on FreeBSD, it makes sense to
#!/bin/csh set path_to_script = set NAMEJAILS =( ) foreach n ($NAMEJAIL) set jjid = ( `jls -j $n jid` ) echo $jjid jexec $jjid $path_to_script end
It is important to use the jail id, rather than the name, as a possible
race could occur from the time the jail is looked up and the command
gets executed inside the jail. This is documented in the manual for
This simple script can be built upon, saving hours of administration
Copyright (c) 2019, Jason Edward Durrett - All content on this site, unless otherwise noted, is subject to this license.
Please contact me if any errors, such as erroneous / misleading content or missing / incomplete attribution, are found.