From: Ulrich Dangel Date: Sun, 25 Oct 2009 14:24:29 +0000 (+0100) Subject: Only remove digits from DEVICE in grml-reboot if DEVICE is not already a X-Git-Tag: v1.1.27~1 X-Git-Url: http://git.grml.org/?p=grml-etc.git;a=commitdiff_plain;h=a216e231483af45806a84360a4d7bfa97efb28e6 Only remove digits from DEVICE in grml-reboot if DEVICE is not already a valid block device name. --- diff --git a/etc/init.d/grml-reboot b/etc/init.d/grml-reboot index 7f14558..81ab23a 100755 --- a/etc/init.d/grml-reboot +++ b/etc/init.d/grml-reboot @@ -49,7 +49,7 @@ if ! $INSTALLED ; then DEVICE="" if [ -n "$CDROM" ] ; then DEVICE="${CDROM##/dev/}" - DEVICE="${DEVICE%%[0-9]*}" + [ -d /sys/block/${DEVICE} ] || DEVICE="${DEVICE%%[0-9]*}" if [ -n "$DEVICE" ] ; then # is it a removable device?