]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
init/shutdown: use "command -v" instead of "type"
authorHarald Hoyer <harald@redhat.com>
Tue, 7 Feb 2012 17:42:04 +0000 (18:42 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 7 Feb 2012 18:28:59 +0000 (19:28 +0100)
modules.d/99base/init
modules.d/99shutdown/shutdown

index bc4ad2c983afd3caef5812920719e76316c6687d..f8d52f70d811428e65d88dd59626bc16ec7a64e9 100755 (executable)
@@ -60,7 +60,7 @@ emergency_shell()
         export PS1="$_rdshell_name:\${PWD}# "
         [ -e /.profile ] || >/.profile
         _ctty=/dev/console
-        if type setsid >/dev/null 2>&1; then
+        if [ -n "$(command -v setsid)" ]; then
             _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
             [ -c "$_ctty" ] || _ctty=/dev/tty1
             setsid sh -i -l 0<$_ctty 1>$_ctty 2>&1
index 21bb37f8d9f1254e0c3449f4ac5196c962a8b52d..019a451a9413032236941aed73a2e2b4595250dc 100755 (executable)
@@ -32,7 +32,7 @@ emergency_shell()
         export PS1="$_rdshell_name:\${PWD}# "
         [ -e /.profile ] || >/.profile
         _ctty=/dev/console
-        if type setsid >/dev/null 2>&1; then
+        if [ -n "$(command -v setsid)" ]; then
             _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
             [ -c "$_ctty" ] || _ctty=/dev/tty1
             setsid sh -i -l 0<$_ctty 1>$_ctty 2>&1