aboutsummaryrefslogtreecommitdiff
path: root/sh.Linux/init.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh.Linux/init.sh')
-rwxr-xr-xsh.Linux/init.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/sh.Linux/init.sh b/sh.Linux/init.sh
index 524e7538..dc9ee5d6 100755
--- a/sh.Linux/init.sh
+++ b/sh.Linux/init.sh
@@ -109,6 +109,24 @@ get_KV() {
return $?
}
+KV_to_int() {
+ [ -z $1 ] && return 1
+
+ local x=${1%%-*}
+ local KV_MAJOR=${x%%.*}
+ x=${x#*.}
+ local KV_MINOR=${x%%.*}
+ x=${x#*.}
+ local KV_MICRO=${x%%.*}
+ local KV_int=$((${KV_MAJOR} * 65536 + ${KV_MINOR} * 256 + ${KV_MICRO} ))
+
+ # We make version 2.2.0 the minimum version we will handle as
+ # a sanity check ... if its less, we fail ...
+ [ "${KV_int}" -lt 131584 ] && return 1
+
+ echo "${KV_int}"
+}
+
. /etc/init.d/functions.sh
. "${RC_LIBDIR}"/sh/init-functions.sh
. "${RC_LIBDIR}"/sh/rc-functions.sh