/etc/init.d/grml-reboot: use bash as interpreter
[grml-etc.git] / etc / init.d / grml-reboot
index c5e737c..7f14558 100755 (executable)
@@ -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 </dev/console
+CONSOLE=/dev/console
+[ -c "$CONSOLE" ] && exec >"$CONSOLE" 2>&1 <"$CONSOLE"
 
 # default variables
 INSTALLED=false
@@ -55,7 +56,7 @@ if ! $INSTALLED ; then
        [ "$(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