aboutsummaryrefslogtreecommitdiff
path: root/src/main/unix/files/root/bin/method
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-12-23 17:35:06 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2012-12-23 17:35:06 +0100
commit8e64eff782aa9d695afc6ee92f4f428c33ec8d23 (patch)
tree8dca8f7b424046e261ce2d82b6fd0f251fc15a1c /src/main/unix/files/root/bin/method
parentee505cf229d193a011c2564733bff102404291ab (diff)
downloadesper-testing-8e64eff782aa9d695afc6ee92f4f428c33ec8d23.tar.gz
esper-testing-8e64eff782aa9d695afc6ee92f4f428c33ec8d23.tar.bz2
esper-testing-8e64eff782aa9d695afc6ee92f4f428c33ec8d23.tar.xz
esper-testing-8e64eff782aa9d695afc6ee92f4f428c33ec8d23.zip
o Moving config.properties to etc/ to make it more app.sh compatible.
Diffstat (limited to 'src/main/unix/files/root/bin/method')
-rw-r--r--src/main/unix/files/root/bin/method37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/main/unix/files/root/bin/method b/src/main/unix/files/root/bin/method
new file mode 100644
index 0000000..a6f1a2b
--- /dev/null
+++ b/src/main/unix/files/root/bin/method
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+. $APPSH_HOME/.app/lib/app-common
+
+method=$APPSH_METHOD
+
+if [ -z "$1" ]
+then
+ echo "Missing required argument: app" >&2
+ exit 1
+fi
+
+app=$1
+shift
+
+run() {
+ app=$1; shift
+
+ if [ ! -x bin/$app ]
+ then
+ echo "Unknown app: $app" >&2
+ exit 1
+ fi
+
+ exec "bin/$app" "$@"
+}
+
+case "$method" in
+ run)
+ run "$app" "$@"
+ ;;
+ *)
+ echo "Unknown method: $method" >&2
+ exit 1
+ ;;
+esac
+exit $?