diff options
author | Brandon Bayer <bbayer@multitech.com> | 2016-10-26 15:40:35 -0500 |
---|---|---|
committer | Brandon Bayer <bbayer@multitech.com> | 2016-11-03 16:40:10 -0500 |
commit | 4d6aefceec69079f3069440f6a9d2f3ea30aee89 (patch) | |
tree | 46f0208a5287f2307fc8782ec9c3fee7cc4100d0 /recipes-core/annex-client/annex-client | |
parent | 5e1da7aeca498961c20147c356990752a4cb2d87 (diff) | |
download | meta-mlinux-4d6aefceec69079f3069440f6a9d2f3ea30aee89.tar.gz meta-mlinux-4d6aefceec69079f3069440f6a9d2f3ea30aee89.tar.bz2 meta-mlinux-4d6aefceec69079f3069440f6a9d2f3ea30aee89.zip |
feat: add annex-client
Diffstat (limited to 'recipes-core/annex-client/annex-client')
-rw-r--r-- | recipes-core/annex-client/annex-client/annex-client.init | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/recipes-core/annex-client/annex-client/annex-client.init b/recipes-core/annex-client/annex-client/annex-client.init new file mode 100644 index 0000000..4a5dc4b --- /dev/null +++ b/recipes-core/annex-client/annex-client/annex-client.init @@ -0,0 +1,43 @@ +#!/bin/bash + +MONITOR="/sbin/monitor-annexcd" +CLIENT="annexcd" + +start() { + if [[ $(pidof -x $MONITOR) ]]; then + echo "RM client is already running" + else + echo "Starting RM client" + $MONITOR & + fi +} + +stop() { + MONITOR_PID=$(pidof -x $MONITOR) + CLIENT_PID=$(pidof $CLIENT) + if [[ $MONITOR_PID ]]; then + echo "Stopping RM client" + kill $MONITOR_PID $CLIENT_PID + else + echo "RM client is not running" + fi +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + *) + echo "Usage: /etc/init.d/annex-client {start|stop|restart}" >&2 + exit 1 + ;; +esac + +exit 0 |