From fc9e5baa0d35fcc6ee39f92603c52f1bc80abc1a Mon Sep 17 00:00:00 2001 From: Peter Mrekaj Date: Mon, 22 Jun 2015 19:54:41 -0700 Subject: [PATCH] Add check for mkisofs This check helps to avoid exit the script with the message indicating success even though the mkisofs is missing and an image has not been created. --- contrib/create-basic-configdrive | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/create-basic-configdrive b/contrib/create-basic-configdrive index ac82da0ae5..c3825f5667 100755 --- a/contrib/create-basic-configdrive +++ b/contrib/create-basic-configdrive @@ -55,6 +55,12 @@ if [ $(id -u) -eq 0 ]; then exit 1 fi +# mkisofs tool check +if ! which mkisofs &>/dev/null; then + echo "$0: mkisofs tool is required to create image." >&2 + exit 1 +fi + if [ -z "$HNAME" ]; then echo "$0: The hostname parameter '-H' is required." >&2 exit 1