From 7c064f5202c9ae9915ae92f684831f2059d3e3a9 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 27 Feb 2012 12:50:29 -0300 Subject: Check if config version is supported by keyringer --- lib/keyringer/functions | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib') diff --git a/lib/keyringer/functions b/lib/keyringer/functions index a1c95a8..8166370 100644 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -234,6 +234,16 @@ function keyringer_check_version { fi VERSION="`cat $VERSION_INFO`" + + # Check if config version is supported by keyringer + if [ "$VERSION" != "$KEYRINGER_VERSION" ]; then + NEWEST="`echo -e "$VERSION\n$KEYRINGER_VERSION" | sort -V | tail -n 1`" + if [ "$NEWEST" == "$VERSION" ]; then + echo "Fatal: keyringer version: $KEYRINGER_VERSION / config version: $VERSION" + echo "Please upgrade your keyringer application" + exit 1 + fi + fi } # Configuration upgrades -- cgit v1.2.3