diff options
author | Pierre Cazenave <pwcazenave at gmail {dot} com> | 2010-12-16 20:05:15 -0200 |
---|---|---|
committer | Erik Hanson <erik@slackbuilds.org> | 2010-12-17 07:56:48 -0600 |
commit | 4f983c2e511d1ed2832dc7a01254ff6d3dbce7f6 (patch) | |
tree | 79025c40de329f440e7067b5a6c0fb9cf5a1b719 /desktop/synergy-plus/rc.synergys | |
parent | 63b68a1eaedeadab514b3109a574332d9db09d03 (diff) |
desktop/synergy-plus: New init-script, man-pages & config
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'desktop/synergy-plus/rc.synergys')
-rw-r--r-- | desktop/synergy-plus/rc.synergys | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/desktop/synergy-plus/rc.synergys b/desktop/synergy-plus/rc.synergys new file mode 100644 index 0000000000000..61f72afcf0395 --- /dev/null +++ b/desktop/synergy-plus/rc.synergys @@ -0,0 +1,70 @@ +#!/bin/bash +# +# By Steven King 11/3/2010 +# kingrst@gmail.com +# +# Modified by Pierre Cazenave 3rd November 2010 +# pwcazenave <at> gmail {dot} com +# +# Starts the Synergy-Plus Server +# + +synergy_start() { + + if [ -f /var/run/synergys.pid ]; then + echo "Synergy Server is already running" + exit 1 + elif [ -x /usr/bin/synergys ]; then + /usr/bin/synergys || exit $? + + pidof synergys > /var/run/synergys.pid + echo "Synergy Server Started" + fi + +} + +synergy_stop() { + + if [ -f /var/run/synergys.pid ]; then + kill $(cat /var/run/synergys.pid) || echo "Unable to stop Synergy Server" + + rm -f /var/run/synergys.pid + echo "Synergy Server Stopped" + else + echo "Synergy Server is not started" + fi + +} + +synergy_status() { + + if [ -f /var/run/synergys.pid ]; then + echo "Synergy Server Running" + echo "PID: $(cat /var/run/synergys.pid)" + else + echo "Synergy Server is not started" + fi + +} + + +case "$1" in + "start") + synergy_start + ;; + "stop") + synergy_stop + ;; + "status") + synergy_status + ;; + "restart") + synergy_stop + sleep 1 + synergy_start + ;; + *) + echo "$0 Usage: [start|stop|restart|status]" + ;; +esac + |