updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / rsync-transliterate / rsyncd
blob573130fb3a9947525cabfb93d40b59d2dc2ba0f4
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 case "$1" in
7 start)
8 stat_busy "Starting rsyncd"
9 [ ! -f /var/run/daemons/rsyncd ] && /usr/bin/rsync --daemon
10 if [ $? -gt 0 ]; then
11 stat_fail
12 else
13 #pgrep -of "/usr/bin/rsync --daemon" > /var/run/rsyncd.pid # Removed FS#20942
14 add_daemon rsyncd
15 stat_done
19 stop)
20 stat_busy "Stopping rsyncd"
21 [ -f /var/run/rsyncd.pid ] && kill `cat /var/run/rsyncd.pid`
22 if [ $? -gt 0 ]; then
23 stat_fail
24 else
25 rm_daemon rsyncd
26 stat_done
29 restart)
30 $0 stop
31 sleep 1
32 $0 start
35 echo "usage: $0 {start|stop|restart}"
36 esac
37 exit 0