Execute a set of commands inside each active jail.
To execute a set of commands inside each active jail you can use shell script:
#!/bin/sh jails=`ezjail-admin list | grep -v "^STA" | grep -v "N/A" | grep -v "^\-" | awk '{ print $4}'` for jail in $jails; do ezjail-admin console $jail << COMMANDS # do something inside jail cd /var/mail/ && ls COMMANDS done
To mount port tree inside each active jail execute shell script:
#!/bin/sh ports_dir="/home/jails/general/ports" jails=`ezjail-admin list | grep -v "^STA" | grep -v "N/A" | grep -v "^\-" | awk '{ print $5}'` for jail in $jails; do # start mess here mount_nullfs ${ports_dir} ${jail}/usr/ports done