[gentoo-x86] / sys-apps / util-linux / files / crypto-loop.initd Project Root:

GentooDiff of /sys-apps/util-linux/files/crypto-loop.initd

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph

version 1.3, Fri Feb 1 12:36:44 2008 UTC version 1.4, Sun Oct 26 03:16:48 2008 UTC
Line 18 
Line 18 
   
         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}
Line 26 
Line 26 
                         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
Line 53 
Line 53 
   
 stop() {  stop() {
         local status="0"          local status="0"
         for loop in $(ls /dev/loop[0-9]) ; do          for loop in $(ls /dev/loop[0-9] 2>/dev/null) ; do
                 losetup ${loop} &> /dev/null                  losetup ${loop} > /dev/null 2>&1
                 if [[ $? == 0 ]] ; then                  if [ $? -eq 0 ] ; then
                         umount ${loop} &>/dev/null || swapoff "${loop}" &>/dev/null                          ( umount ${loop} || swapoff "${loop}" ) >/dev/null 2>&1
                         if ! /sbin/losetup -d ${loop} &> /dev/null ; then                          if ! /sbin/losetup -d ${loop} > /dev/null 2>&1; then
                                 ewarn "Failure deconfiguring ${loop}."                                  ewarn "Failure deconfiguring ${loop}."
                                 status=1                                  status=1
                         fi                          fi

Generate output suitable for use with a patch program
Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

www@gentoo.org

Powered by ViewCVS 1.0_pre20050929

ViewCVS and CVS Help