From: Harald Hoyer Date: Tue, 7 Feb 2012 17:42:04 +0000 (+0100) Subject: init/shutdown: use "command -v" instead of "type" X-Git-Tag: 015~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de247618e77c8d902dfb9ba1889d30d8623b1e17;p=thirdparty%2Fdracut.git init/shutdown: use "command -v" instead of "type" --- diff --git a/modules.d/99base/init b/modules.d/99base/init index bc4ad2c98..f8d52f70d 100755 --- a/modules.d/99base/init +++ b/modules.d/99base/init @@ -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 diff --git a/modules.d/99shutdown/shutdown b/modules.d/99shutdown/shutdown index 21bb37f8d..019a451a9 100755 --- a/modules.d/99shutdown/shutdown +++ b/modules.d/99shutdown/shutdown @@ -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