diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-04-20 21:44:09 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-04-20 21:57:36 +0200 |
commit | cb9eea1db0715cc8c944f54e61270d25502e3163 (patch) | |
tree | cc2d07a4879cc6f1f867de04d46fbeb0da2b2e5c /libexec/app-operator-pid | |
parent | 875716dc48cd5c485d2342c9e5bb1d461bc64b6d (diff) | |
download | app.sh-cb9eea1db0715cc8c944f54e61270d25502e3163.tar.gz app.sh-cb9eea1db0715cc8c944f54e61270d25502e3163.tar.bz2 app.sh-cb9eea1db0715cc8c944f54e61270d25502e3163.tar.xz app.sh-cb9eea1db0715cc8c944f54e61270d25502e3163.zip |
o Exposing 'status' and 'restart' commands again.
Diffstat (limited to 'libexec/app-operator-pid')
-rwxr-xr-x | libexec/app-operator-pid | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libexec/app-operator-pid b/libexec/app-operator-pid index dd48979..db1da1f 100755 --- a/libexec/app-operator-pid +++ b/libexec/app-operator-pid @@ -83,14 +83,14 @@ command_stop() { case `do_status` in stopped) echo "The application not running." - exit 1 + return 1 ;; crashed) echo "The application crashed. Was running as $PID" # TODO: should this remove the PID file? That makes it # possible to run "stop" to stop "status" from showing # "crashed". Perhaps just a "clear" goal to clear the pid file. - exit 1 + return 1 ;; esac @@ -140,6 +140,13 @@ command_status() { esac } +command_restart() { + set +e + command_stop + set -e + command_start +} + APP_HOME=${APP_HOME-} if [[ $APP_HOME == "" ]] @@ -158,8 +165,10 @@ fi command="$1" case "$command" in - start|stop|status) + start|stop|status|restart) command_$command + ret=$? + exit $ret ;; *) fatal "Invalid command: $command" |