From cdfcae52a49118d43e2064dd228b789b8452664f Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 12 Oct 2012 23:23:10 +0200 Subject: Major refactoring. Splitting out the method groups into separate files. --- .app/lib/pid-method | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 .app/lib/pid-method (limited to '.app/lib/pid-method') diff --git a/.app/lib/pid-method b/.app/lib/pid-method new file mode 100755 index 0000000..e718849 --- /dev/null +++ b/.app/lib/pid-method @@ -0,0 +1,37 @@ +#!/bin/bash + +set -e + +PID_FILE=$APPSH_BASEDIR/.app/var/pid/$name-$instance.pid + +. $APPSH_BASEDIR/.app/lib/app-conf + +bin=`get_conf $APPSH_BASEDIR $APPSH_NAME $APPSH_INSTANCE app.bin` + +if [ -z "$bin" ] +then + echo "Missing required configuration: app.bin." >&2 + exit 1 +fi + +if [ ! -r "$bin" ] +then + echo "No such file: $bin" >&2 + exit 1 +fi + +chmod +x "$bin" + +case "$APPSH_METHOD" in + start) + set -x + $bin & + ret=$? + pid=$! + echo "Application launched with PID=$pid" + echo $pid > $PID_FILE + ;; + *) + exit 1 + ;; +esac -- cgit v1.2.3