summaryrefslogtreecommitdiff
path: root/avahi/avahi-daemon.rc
blob: c236813827a1127ec1666ebce570ea3fc7a89fb0 (plain)
    1 #!/bin/sh
    2 #
    3 # /etc/rc.d/avahi-daemon: start/stop avahi daemon
    4 #
    5 
    6 SSD=/sbin/start-stop-daemon
    7 PROG=/usr/sbin/avahi-daemon
    8 PID=/var/run/avahi-daemon/pid
    9 OPTS="-D"
   10 
   11 case $1 in
   12 	start)
   13 		$SSD --start --pidfile $PID --exec $PROG -- $OPTS
   14 		;;
   15 	stop)
   16 		$SSD --stop --retry 10 --name avahi-daemon --pidfile $PID
   17 		;;
   18 	restart)
   19 		$0 stop
   20 		$0 start
   21 		;;
   22 	status)
   23 		$SSD --status --name avahi-daemon --pidfile $PID
   24 		case $? in
   25 			0) echo "$PROG is running with pid $(cat $PID)" ;;
   26 			1) echo "$PROG is not running but the pid file $PID exists" ;;
   27 			3) echo "$PROG is not running" ;;
   28 			4) echo "Unable to determine the program status" ;;
   29 		esac
   30 		;;
   31 	*)
   32 		echo "usage: $0 [start|stop|restart|status]"
   33 		;;
   34 esac
   35 
   36 # End of file

Generated by cgit