From ee44f6297293f895f2e446690a19e7114eff7ae8 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 9 Jul 2015 19:44:30 +0200 Subject: [PATCH] dracut.sh: early check for bash version --- dracut.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dracut.sh b/dracut.sh index 77da887..b7456dc 100755 --- a/dracut.sh +++ b/dracut.sh @@ -22,6 +22,13 @@ # # store for logging + +# Verify bash version, current minimum is 4 +if (( BASH_VERSINFO[0] < 4 )); then + printf -- 'You need at least Bash 4 to use dracut, sorry.' >&2 + exit 1 +fi + dracut_args=( "$@" ) readonly dracut_cmd="$(readlink -f $0)" @@ -828,12 +835,6 @@ if ! [[ $print_cmdline ]]; then rm -fr -- ${initdir}/* fi -# Verify bash version, current minimum is 4 -if (( BASH_VERSINFO[0] < 4 )); then - dfatal 'You need at least Bash 4 to use dracut, sorry.' - exit 1 -fi - dracutfunctions=$dracutbasedir/dracut-functions.sh export dracutfunctions