#!/bin/sh
#
# avahi-daemon init script

RUNNINGAPPSDIR=/ross/app/bin
RUNNINGAPPSDIRCONFIGPATH=/ross/etc/runningAppsPath

if [ -f "$RUNNINGAPPSDIRCONFIGPATH" ]; then
        RADPATH=$(cat $RUNNINGAPPSDIRCONFIGPATH)
        if [ -d "$RADPATH" ]; then
                RUNNINGAPPSDIR=$RADPATH
        fi
fi

DAEMON=/usr/sbin/avahi-daemon
case "$1" in
    start)
	# always start; an IP board could be added post boot
	$DAEMON -c || $DAEMON -D
	;;
    stop)
	$DAEMON -c && $DAEMON -k
	;;
    reload)
	$DAEMON -c && $DAEMON -r
	;;
    *)
	echo "Usage: avahi-daemon {start|stop|reload}" >&2
	exit 1
	;;
esac