X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=initscript%2Fdebian%2Favahi-daemon.in;h=97fa1579398a8a285340412cbfefbcdce81f9537;hb=da6e5ed59ff0994ebf41b2d46a0e1ff40719d699;hp=3a68781f8b7a5fc6db3e2d6c900ff84475bb8010;hpb=166553baf33290c08e41a9fb67567165c0e70fc5;p=catta diff --git a/initscript/debian/avahi-daemon.in b/initscript/debian/avahi-daemon.in index 3a68781..97fa157 100755 --- a/initscript/debian/avahi-daemon.in +++ b/initscript/debian/avahi-daemon.in @@ -1,7 +1,5 @@ #!/bin/sh -# $Id$ - # This file is part of avahi. # # avahi is free software; you can redistribute it and/or modify it @@ -75,6 +73,16 @@ else return $1 } + log_warning_msg () { + if log_use_fancy_output; then + YELLOW=`$TPUT setaf 3` + NORMAL=`$TPUT op` + echo "$YELLOW*$NORMAL $@" + else + echo "$@" + fi + } + fi #set -e @@ -83,10 +91,20 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin DESC="Avahi mDNS/DNS-SD Daemon" NAME="avahi-daemon" DAEMON="@sbindir@/$NAME" +SCRIPTNAME=/etc/init.d/$NAME # Gracefully exit if the package has been removed. test -x $DAEMON || exit 0 +# don't start if /etc/default/avahi-daemon says so. +AVAHI_DAEMON_START=1 +test -f /etc/default/avahi-daemon && . /etc/default/avahi-daemon + +if [ "$AVAHI_DAEMON_START" != "1" -a "$1" != "stop" ]; then + log_warning_msg "Not starting $DESC $NAME, disabled via /etc/default/$NAME" + exit 0 +fi + # # Function that starts the daemon/service. #