X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=initscript%2Fdebian%2Favahi-daemon.in;h=3a68781f8b7a5fc6db3e2d6c900ff84475bb8010;hb=166553baf33290c08e41a9fb67567165c0e70fc5;hp=ddaeba44b6d63d4f02bffb7211b8e483fde249c6;hpb=af1ba2749a5430dac57b5d46929f0159ef8d2fb8;p=catta diff --git a/initscript/debian/avahi-daemon.in b/initscript/debian/avahi-daemon.in index ddaeba4..3a68781 100755 --- a/initscript/debian/avahi-daemon.in +++ b/initscript/debian/avahi-daemon.in @@ -91,6 +91,17 @@ test -x $DAEMON || exit 0 # Function that starts the daemon/service. # d_start() { + modprobe capability >/dev/null 2>&1 || true + + $DAEMON -c && return 0 + + if [ -s /etc/localtime ]; then + if [ ! -d /etc/avahi/etc ]; then + mkdir -p @sysconfdir@/avahi/etc >/dev/null 2>&1 + fi + cp -fp /etc/localtime @sysconfdir@/avahi/etc >/dev/null 2>&1 + fi; + $DAEMON -D } @@ -98,16 +109,22 @@ d_start() { # Function that stops the daemon/service. # d_stop() { - $DAEMON -k || /bin/true + $DAEMON -c && $DAEMON -k } # # Function that reload the config file for the daemon/service. # d_reload() { - $DAEMON -r + $DAEMON -c && $DAEMON -r } +# +# Function that check the status of the daemon/service. +# +d_status() { + $DAEMON -c && echo "$DESC is running" || echo "$DESC is not running" +} case "$1" in start) @@ -127,11 +144,14 @@ case "$1" in ;; restart|force-reload) log_begin_msg "Restarting $DESC: $NAME" - d_stop + $DAEMON -c && d_stop d_start log_end_msg $? ;; - *) + status) + d_status + ;; + *) echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|reload}" >&2 exit 1 ;;