]> git.tuebingen.mpg.de Git - gsu.git/blobdiff - funcs/gsu
gsu: Error out if not running as bash-4.
[gsu.git] / funcs / gsu
index b409bc50bc75d50969d60a800c0710358c34c2d9..cef33b2f903e5e88c3d7187246a502ae4a4b8bd2 100644 (file)
--- a/funcs/gsu
+++ b/funcs/gsu
@@ -389,6 +389,16 @@ gsu()
 {
        local i
 
+       gsu_is_a_number "${BASH_VERSINFO[0]}"
+       if [[ $ret -lt 0 ]]; then
+               gsu_msg "fatal: failed to determine bash version"
+               exit 1
+       fi
+
+       if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then
+               gsu_msg "fatal: This script requires at least bash 4.0"
+               exit 1
+       fi
        _gsu_self="$(basename $0)"
        gsu_name="${gsu_name:=$_gsu_self}"
        gsu_config_var_prefix="${gsu_config_var_prefix:=$gsu_name}"