]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
explicitly verify bash version
authorMichal Soltys <soltys@ziu.info>
Mon, 10 Oct 2011 21:58:05 +0000 (23:58 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 11 Oct 2011 07:37:02 +0000 (09:37 +0200)
A simple check in main dracut script.

Signed-off-by: Michal Soltys <soltys@ziu.info>
dracut

diff --git a/dracut b/dracut
index 63d4ea67cb368b5d6ab5af1c9a8a786c2264a5a7..205f5d1742b0a1936afd339c91e106bd522ba2e6 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -418,6 +418,13 @@ else
     exit 1
 fi
 
+# Verify bash version, curret minimum is 3.1
+if (( ${BASH_VERSINFO[0]} < 3 ||
+    ( ${BASH_VERSINFO[0]} == 3 && ${BASH_VERSINFO[1]} < 1 ) )); then
+    dfatal 'You need at least Bash 3.1 to use dracut, sorry.'
+    exit 1
+fi
+
 dracutfunctions=$dracutbasedir/dracut-functions
 export dracutfunctions