summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2006-03-25 17:42:00 +0000
committererdgeist <erdgeist@erdgeist.org>2006-03-25 17:42:00 +0000
commit57ee5da10b10bb8d9b0fff569b22045a1d3905ec (patch)
tree418b24693ce3174a9dfcda1e2b17aed78b874b78
parent74d5a75caf855fa3b7f2ac8fad5d0c1af312ae70 (diff)
Adding startcrypto and stopcrypto subcommands to start/stop all crypto jails
-rwxr-xr-xezjail.sh8
1 files changed, 7 insertions, 1 deletions
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
20 20
21name=ezjail 21name=ezjail
22rcvar=`set_rcvar` 22rcvar=`set_rcvar`
23extra_commands="startcrypto stopcrypto"
23load_rc_config ${name} 24load_rc_config ${name}
24 25
25ezjail_enable=${ezjail_enable:-"NO"} 26ezjail_enable=${ezjail_enable:-"NO"}
@@ -27,6 +28,8 @@ ezjail_enable=${ezjail_enable:-"NO"}
27restart_cmd="do_cmd restart _" 28restart_cmd="do_cmd restart _"
28start_cmd="do_cmd start '_ ezjail'" 29start_cmd="do_cmd start '_ ezjail'"
29stop_cmd="do_cmd stop '_ ezjail'" 30stop_cmd="do_cmd stop '_ ezjail'"
31startcrypto_cmd="do_cmd startcrypto _"
32stopcrypto_cmd="do_cmd stopcrypto _"
30 33
31do_cmd() 34do_cmd()
32{ 35{
@@ -63,6 +66,9 @@ do_cmd()
63 # Cannot auto mount crypto jails without interrupting boot process 66 # Cannot auto mount crypto jails without interrupting boot process
64 [ "${ezjail_fromrc}" = "YES" -a "${ezjail_crypt}" = "YES" -a "${action}" = "start" ] && continue 67 [ "${ezjail_fromrc}" = "YES" -a "${ezjail_crypt}" = "YES" -a "${action}" = "start" ] && continue
65 68
69 # Explicitely do only run crypto jails
70 [ "${action%crypto}" != "${action}" -a "${ezjail_crypt}" = "YES" ] && continue
71
66 # Try to attach (crypto) devices 72 # Try to attach (crypto) devices
67 [ "${ezjail_image}" ] && attach_detach_pre 73 [ "${ezjail_image}" ] && attach_detach_pre
68 74
@@ -70,7 +76,7 @@ do_cmd()
70 done 76 done
71 77
72 # Pass control to jail script which does the actual work 78 # Pass control to jail script which does the actual work
73 [ "${ezjail_pass}" ] && sh /etc/rc.d/jail one${action} ${ezjail_pass} 79 [ "${ezjail_pass}" ] && sh /etc/rc.d/jail one${action%crypto} ${ezjail_pass}
74 80
75 # Can only detach after unmounting (from fstab.JAILNAME in /etc/rc.d/jail) 81 # Can only detach after unmounting (from fstab.JAILNAME in /etc/rc.d/jail)
76 attach_detach_post 82 attach_detach_post