From 57ee5da10b10bb8d9b0fff569b22045a1d3905ec Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 25 Mar 2006 17:42:00 +0000 Subject: Adding startcrypto and stopcrypto subcommands to start/stop all crypto jails --- ezjail.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ezjail.sh b/ezjail.sh index b081bbf..41a4ca8 100755 --- a/ezjail.sh +++ b/ezjail.sh @@ -20,6 +20,7 @@ ezjail_prefix=EZJAIL_PREFIX name=ezjail rcvar=`set_rcvar` +extra_commands="startcrypto stopcrypto" load_rc_config ${name} ezjail_enable=${ezjail_enable:-"NO"} @@ -27,6 +28,8 @@ ezjail_enable=${ezjail_enable:-"NO"} restart_cmd="do_cmd restart _" start_cmd="do_cmd start '_ ezjail'" stop_cmd="do_cmd stop '_ ezjail'" +startcrypto_cmd="do_cmd startcrypto _" +stopcrypto_cmd="do_cmd stopcrypto _" do_cmd() { @@ -63,6 +66,9 @@ do_cmd() # Cannot auto mount crypto jails without interrupting boot process [ "${ezjail_fromrc}" = "YES" -a "${ezjail_crypt}" = "YES" -a "${action}" = "start" ] && continue + # Explicitely do only run crypto jails + [ "${action%crypto}" != "${action}" -a "${ezjail_crypt}" = "YES" ] && continue + # Try to attach (crypto) devices [ "${ezjail_image}" ] && attach_detach_pre @@ -70,7 +76,7 @@ do_cmd() done # Pass control to jail script which does the actual work - [ "${ezjail_pass}" ] && sh /etc/rc.d/jail one${action} ${ezjail_pass} + [ "${ezjail_pass}" ] && sh /etc/rc.d/jail one${action%crypto} ${ezjail_pass} # Can only detach after unmounting (from fstab.JAILNAME in /etc/rc.d/jail) attach_detach_post -- cgit v1.2.3