PKGBUILDs/core/rsync/rsyncd

38 lines
686 B
Text
Raw Normal View History

2009-09-26 14:35:50 +00:00
#!/bin/bash
2009-09-26 17:10:12 +00:00
. /opt/etc/rc.conf
. /opt/etc/rc.d/functions
2009-09-26 14:35:50 +00:00
case "$1" in
start)
stat_busy "Starting rsyncd"
2009-09-26 17:10:12 +00:00
[ ! -f /opt/var/run/daemons/rsyncd ] && /opt/bin/rsync --daemon
2009-09-26 14:35:50 +00:00
if [ $? -gt 0 ]; then
stat_fail
else
2009-09-26 17:10:12 +00:00
pgrep -of "/opt/bin/rsync --daemon" > /opt/var/run/rsyncd.pid
2009-09-26 14:35:50 +00:00
add_daemon rsyncd
stat_done
fi
;;
stop)
stat_busy "Stopping rsyncd"
2009-09-26 17:10:12 +00:00
[ -f /opt/var/run/rsyncd.pid ] && kill `cat /opt/var/run/rsyncd.pid`
2009-09-26 14:35:50 +00:00
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon rsyncd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0