#! /bin/bash start() { /usr/bin/rsync --daemon & } stop() { kill `cat /var/run/rsyncd.pid` } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; *) echo $"Usage: $0 {start|stop|restart}" exit 2 esac exit $?
#! /bin/bash start() { /usr/bin/rsync --daemon & } stop() { kill `cat /var/run/rsyncd.pid` } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; *) echo $"Usage: $0 {start|stop|restart}" exit 2 esac exit $?