updated on Mon Jan 23 00:00:36 UTC 2012
[aur-mirror.git] / synergy-gnome3-fixed / synergys.rc
blob758ceaf10860ef529fef5217ea9c88d0f7035d29
1 #!/bin/bash
3 daemon_name=synergys
5 . /etc/rc.conf
6 . /etc/rc.d/functions
8 PID=`pidof -o %PPID /usr/bin/synergys`
9 case "$1" in
10 start)
11 stat_busy "Starting Synergy Server"
12 [ -z "$PID" ] && /usr/bin/synergys --config /etc/synergy.conf &> /dev/null
13 if [ $? -gt 0 ]; then
14 stat_fail
15 else
16 add_daemon $daemon_name
17 stat_done
20 stop)
21 stat_busy "Stopping Synergy Server"
22 [ ! -z "$PID" ] && kill -9 $PID &> /dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon $daemon_name
27 stat_done
30 restart)
31 $0 stop
32 sleep 1
33 $0 start
35 *)
36 echo "usage: $0 {start|stop|restart}"
37 esac
38 exit 0