diff --git a/ur/fortinet.vpn.v7.sh b/ur/fortinet.vpn.v7.sh index 60578ec..4d449de 100755 --- a/ur/fortinet.vpn.v7.sh +++ b/ur/fortinet.vpn.v7.sh @@ -167,6 +167,31 @@ ${RED}${local_command_available_cmd}${COLOR_DEBUG} is not available on this host return "${return_command_available}" } # }}} +is_version_greater_than() { # {{{ + + first_value="${1}" + value_to_compare="${2}" + + ## Return False by default + return_is_version_greater_than="1" + + debug_message "is_version_greater_than − \ +Is first value (${first_value}) greater than the second value (${value_to_compare})." + + if printf '%s\n' "${first_value}" "${value_to_compare}" | sort --check=quiet --version-sort; then + debug_message "is_version_greater_than − ${first_value} <= ${value_to_compare} ." + return_is_version_greater_than="1" + else + debug_message "is_version_greater_than − ${first_value} > ${value_to_compare} ." + return_is_version_greater_than="0" + fi + + unset first_value + unset value_to_compare + + return "${return_is_version_greater_than}" +} +# }}} main() { # {{{