kernel - Make certain sysctl's unlocked
[dragonfly.git] / etc / rc.d / cryptdisks
blob3bc62327a23b6daea60ba320330689944c65494d
1 #!/bin/sh
3 # PROVIDE: cryptdisks
4 # BEFORE: mountcritlocal localswap dumpon
6 $_rc_subr_loaded . /etc/rc.subr
8 name="cryptdisks"
9 start_cmd="cryptdisks_start"
10 stop_cmd="cryptdisks_stop"
11 CRYPTTAB="/etc/crypttab"
13 cryptdisks_start()
15 if [ ! -f $CRYPTTAB ]; then
16 return 0;
19 if [ -x /sbin/dmsetup ]; then
20 /sbin/dmsetup version >/dev/null 2>&1
21 if [ $? -ne 0 ]; then
22 warn "/etc/crypttab found but dm is not loaded or present in kernel"
23 return 1;
27 echo "Configuring crypto disks."
28 /sbin/cryptdisks -1
31 cryptdisks_stop()
33 if [ ! -f $CRYPTTAB ]; then
34 return 0;
37 if [ -x /sbin/dmsetup ]; then
38 /sbin/dmsetup version >/dev/null 2>&1
39 if [ $? -ne 0 ]; then
40 warn "/etc/crypttab found but dm is not loaded or present in kernel"
41 return 1;
45 echo "Unconfiguring crypto disks."
46 /sbin/cryptdisks -0
50 load_rc_config $name
51 run_rc_command "$1"