Added script checkUpgrade.sh
authorBenjamin Renard <brenard@easter-eggs.com>
Tue, 9 Nov 2010 16:40:52 +0000 (17:40 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Tue, 9 Nov 2010 16:40:52 +0000 (17:40 +0100)
checkUpgrade.sh [new file with mode: 0755]

diff --git a/checkUpgrade.sh b/checkUpgrade.sh
new file mode 100755 (executable)
index 0000000..abb7580
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+ROOT_DIR=$( cd `dirname $0`; pwd )
+
+cd $ROOT_DIR
+
+git fetch -q
+
+CURRENT=`git show HEAD|head -n1`
+LASTEST=`git show FETCH_HEAD|head -n1`
+
+[ "$1" = "-d" ] && echo -e "Current : $CURRENT\nLastest : $LASTEST"
+
+if [ "$CURRENT" != "$LASTEST" ]
+then
+    echo "New update is available"
+    echo "======================="
+    echo "Current installation of LdapSaisie is from the $CURRENT."
+    echo "Changes have been made since."
+    echo
+    echo "The lastest commit is : "
+    echo 
+    git show FETCH_HEAD|cat
+    echo
+    echo "** /!\\ You have to run the script upgradeFromGit.sh to upgrade your installation. /!\\ **"
+fi