From 04669dd33b624a9827e335dff15d99f703ca49f8 Mon Sep 17 00:00:00 2001 From: Chris Ball Date: Wed, 23 Dec 2009 20:20:50 -0500 Subject: Add depschecking; check environment variables are pointing at existing files --- etherpad/bin/rebuildjar.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/etherpad/bin/rebuildjar.sh b/etherpad/bin/rebuildjar.sh index 61f180f..3238163 100755 --- a/etherpad/bin/rebuildjar.sh +++ b/etherpad/bin/rebuildjar.sh @@ -31,6 +31,32 @@ if [ -z "$JAR" ]; then fi fi +function depscheck { + if [ ! -d "$JAVA_HOME" ]; then + echo "\$JAVA_HOME does not point to an existing dir; should be e.g. /usr/java/latest" + exit 1 + fi + if [ ! -d "$SCALA_HOME" ]; then + echo "\$SCALA_HOME does not point to an existing dir; should be e.g. /usr/share/scala" + exit 1 + fi + if [ ! -e "$SCALA" ]; then + echo "\$SCALA does not point to an existing file; should be e.g. /usr/bin/scala" + exit 1 + fi + if [ ! -e "$JAVA" ]; then + echo "\$JAVA does not point to an existing file; should be e.g. /usr/bin/java" + exit 1 + fi + if [ ! -e "$MYSQL_CONNECTOR_JAR" ]; then + echo "\$MYSQL_CONNECTOR_JAR does not point to an existing file; should be e.g. /usr/share/java/mysql-connector-java.jar" + exit 1 + fi + +} + +depscheck + function notify { if [ ! -z $(which growlnotify 2>/dev/null) ]; then echo $0 finished | growlnotify -- cgit v1.2.3-1-g7c22