From a216e231483af45806a84360a4d7bfa97efb28e6 Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sun, 25 Oct 2009 15:24:29 +0100 Subject: [PATCH] Only remove digits from DEVICE in grml-reboot if DEVICE is not already a valid block device name. --- etc/init.d/grml-reboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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? -- 2.1.4