]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
99base: warn on invalid command for initqueue
authorHannes Reinecke <hare@suse.de>
Thu, 11 Dec 2014 14:46:10 +0000 (15:46 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 16 Dec 2014 12:29:36 +0000 (13:29 +0100)
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 <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
modules.d/99base/initqueue.sh

index 4a07da37f779f58733c83fbf2c9679c0984cac6b..193cc5c6c62c9ce29419a23b499da70eb2e6a5de 100755 (executable)
@@ -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"'