gbde (126744) | gbde (132356) |
---|---|
1#!/bin/sh 2# 3# This file, originally written by Garrett A. Wollman, is in the public 4# domain. 5# | 1#!/bin/sh 2# 3# This file, originally written by Garrett A. Wollman, is in the public 4# domain. 5# |
6# $FreeBSD: head/etc/rc.d/gbde 126744 2004-03-08 12:25:05Z pjd $ | 6# $FreeBSD: head/etc/rc.d/gbde 132356 2004-07-18 18:01:48Z simon $ |
7# 8 9# PROVIDE: disks 10# KEYWORD: FreeBSD nojail 11 12. /etc/rc.subr 13 14name="gbde" --- 61 unchanged lines hidden (view full) --- 76 return 0 77} 78 79gbde_start() 80{ 81 for device in $gbde_devices; do 82 parentdev=${device%.bde} 83 parent=${parentdev#/dev/} | 7# 8 9# PROVIDE: disks 10# KEYWORD: FreeBSD nojail 11 12. /etc/rc.subr 13 14name="gbde" --- 61 unchanged lines hidden (view full) --- 76 return 0 77} 78 79gbde_start() 80{ 81 for device in $gbde_devices; do 82 parentdev=${device%.bde} 83 parent=${parentdev#/dev/} |
84 eval "lock=\${gbde_lock_${parent}-\"/etc/${parent}.lock\"}" 85 if [ -e $lock ]; then | 84 eval "lock=\${gbde_lock_${parent}-\"${gbde_lockdir}/${parent}.lock\"}" 85 if [ -e "${lock}" -a ! -e "${device}" ]; then |
86 echo "Configuring Disk Encryption for ${device}." | 86 echo "Configuring Disk Encryption for ${device}." |
87 gbde attach ${parentdev} -l ${lock} | 87 88 count=1 89 while [ ${count} -le ${gbde_attach_attempts} ]; do 90 gbde attach ${parentdev} -l ${lock} 91 if [ -e ${device} ]; then 92 break 93 fi 94 echo "Attach failed; attempt ${count} of ${gbde_attach_attempts}." 95 count=$((${count} + 1)) 96 done 97 |
88 fi 89 done 90} 91 92gbde_stop() 93{ 94 for device in $gbde_devices; do 95 umount ${device} 96 gbde detach ${device%.bde} 97 done 98} 99 100load_rc_config $name 101run_rc_command "$1" | 98 fi 99 done 100} 101 102gbde_stop() 103{ 104 for device in $gbde_devices; do 105 umount ${device} 106 gbde detach ${device%.bde} 107 done 108} 109 110load_rc_config $name 111run_rc_command "$1" |