From: Hannes Reinecke Date: Thu, 11 Dec 2014 14:46:10 +0000 (+0100) Subject: 99base: warn on invalid command for initqueue X-Git-Tag: 041~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c2311660f3f540c2ad9471bcc13686899d677cd;p=thirdparty%2Fdracut.git 99base: warn on invalid command for initqueue When 'initqueue' is called with an invalid command it'll generate invalid job scripts. This will lead to confusing error messages later on. So abort in these cases and print out a warning. Signed-off-by: Hannes Reinecke Signed-off-by: Thomas Renninger --- diff --git a/modules.d/99base/initqueue.sh b/modules.d/99base/initqueue.sh index 4a07da37f..193cc5c6c 100755 --- a/modules.d/99base/initqueue.sh +++ b/modules.d/99base/initqueue.sh @@ -42,6 +42,10 @@ exe=$1 shift [ -x "$exe" ] || exe=$(command -v $exe) +if [ -z "$exe" ] ; then + echo "Invalid command" + exit 1 +fi { [ -n "$onetime" ] && echo '[ -e "$job" ] && rm -f -- "$job"'