View | Details | Raw Unified
Collapse All | Expand All

(-) file_not_specified_in_diff (-9 / +10 lines)
 Lines 18-24    Link Here 
	ebegin "Starting crypto loop devices"
	ebegin "Starting crypto loop devices"
	if [[ -e /etc/conf.d/crypto-loop ]] ; then
	if [ -e /etc/conf.d/crypto-loop ] ; then
		egrep "^loop" /etc/conf.d/crypto-loop | \
		egrep "^loop" /etc/conf.d/crypto-loop | \
		while read loopline ; do
		while read loopline ; do
			eval ${loopline}
			eval ${loopline}
 Lines 26-42    Link Here 
			local configured=$(awk -v MOUNT="${device}" \
			local configured=$(awk -v MOUNT="${device}" \
				'($2 == MOUNT) { print "yes" }' /proc/mounts)
				'($2 == MOUNT) { print "yes" }' /proc/mounts)
			if [[ ${configured} != "yes" ]] ; then
			if [ "${configured}" != "yes" ] ; then
				einfo "  Loop ${loop} on device ${device} (cipher ${cipher}, key size ${keysize}): "
				einfo "  Loop ${loop} on device ${device} (cipher ${cipher}, key size ${keysize}): "
				if [[ -n ${hash} ]] ; then
				if [ -n ${hash} ] ; then
					/usr/sbin/hashalot -n ${keysize} ${hash} </dev/tty|\
					/usr/sbin/hashalot -n ${keysize} ${hash} </dev/tty|\
					/sbin/losetup -p 0 -e ${cipher}-${keysize} ${loop} ${device} ${other}
					/sbin/losetup -p 0 -e ${cipher}-${keysize} ${loop} ${device} ${other}
				else
				else
					/sbin/losetup -e ${cipher}-${keysize} ${loop} ${device} ${other}
					/sbin/losetup -e ${cipher}-${keysize} ${loop} ${device} ${other}
				fi
				fi
				if [[ $? -ne 0 ]] ; then
				if [ $? -ne 0 ] ; then
					ewarn "Failure configuring ${loop}.  Skipping."
					ewarn "Failure configuring ${loop}.  Skipping."
					status=1
					status=1
				fi
				fi
 Lines 53-63    Link Here 
stop() {
stop() {
	local status="0"
	local status="0"
	for loop in $(ls /dev/loop[0-9]) ; do
	for loop in /dev/loop[0-9] ; do
		losetup ${loop} &> /dev/null
		[ -e "${loop}" ] || continue
		if [[ $? == 0 ]] ; then
		losetup ${loop} > /dev/null 2>&1
			umount ${loop} &>/dev/null || swapoff "${loop}" &>/dev/null
		if [ $? -eq 0 ] ; then
			if ! /sbin/losetup -d ${loop} &> /dev/null ; then
			umount ${loop} >/dev/null 2>&1 || swapoff "${loop}" >/dev/null 2>&1
			if ! /sbin/losetup -d ${loop} > /dev/null 2>&1; then
				ewarn "Failure deconfiguring ${loop}."
				ewarn "Failure deconfiguring ${loop}."
				status=1
				status=1
			fi
			fi