X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Finit.d%2Fgrml-reboot;h=81ab23aebaba47a7b2eb9cb0200e278251f96b98;hb=a216e231483af45806a84360a4d7bfa97efb28e6;hp=c5e737cb7836a458f0b66a9fdbe5b18801bafa33;hpb=f93db4cce61e7dbdd78e7cbccffb5c4511c72f8d;p=grml-etc.git diff --git a/etc/init.d/grml-reboot b/etc/init.d/grml-reboot index c5e737c..81ab23a 100755 --- a/etc/init.d/grml-reboot +++ b/etc/init.d/grml-reboot @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Filename: grml-reboot # Purpose: reboot grml system # Authors: grml-team (grml.org) @@ -14,7 +14,8 @@ export PATH=/sbin:/bin:/usr/bin:/usr/sbin cd / # Clean input/output -exec >/dev/console 2>&1 "$CONSOLE" 2>&1 <"$CONSOLE" # default variables INSTALLED=false @@ -48,14 +49,14 @@ 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? [ "$(cat /sys/block/${DEVICE}/removable 2>/dev/null)" = "1" ] && REMOVABLE=true # is it a usb device? readlink /sys/block/${DEVICE} 2>/dev/null | grep -q '/usb' && USB_DEVICE=true - $USB_DEVICE && USB_INFO="$(cat /sys/block/${DEVICE}/device/model 2>/dev/null)" + $USB_DEVICE && USB_INFO=" ($(cat /sys/block/${DEVICE}/device/model 2>/dev/null))" fi fi fi