Only remove digits from DEVICE in grml-reboot if DEVICE is not already a
authorUlrich Dangel <uli@spamt.net>
Sun, 25 Oct 2009 14:24:29 +0000 (15:24 +0100)
committerUlrich Dangel <uli@spamt.net>
Mon, 26 Oct 2009 09:40:01 +0000 (10:40 +0100)
valid block device name.

etc/init.d/grml-reboot

index 7f14558..81ab23a 100755 (executable)
@@ -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?