5 # This file is part of avahi.
7 # avahi is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as
9 # published by the Free Software Foundation; either version 2 of the
10 # License, or (at your option) any later version.
12 # avahi is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 # License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with avahi; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 # avahi-dnsconfd avahi dns configuration daemon
26 # Authors: <sebastien.estienne@gmail.com>
29 if [ -f /lib/lsb/init-functions ]
31 . /lib/lsb/init-functions
33 # int log_begin_message (char *message)
41 # int log_end_message (int exitstatus)
44 # If no arguments were passed, return
45 [ -z "$1" ] && return 1
47 # Only do the fancy stuff if we have an appropriate terminal
48 # and if /usr is already mounted
51 if [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1; then
53 if [ -n "$COLS" ]; then
66 echo -e "$UP$START $RED*$NORMAL$END[${RED}fail${NORMAL}]"
82 PATH=/sbin:/bin:/usr/sbin:/usr/bin
83 DESC="Avahi Unicast DNS Configuration Daemon"
85 DAEMON="@sbindir@/$NAME"
87 # Gracefully exit if the package has been removed.
88 test -x $DAEMON || exit 0
91 # Function that starts the daemon/service.
97 if [ -s /etc/localtime ]; then
98 if [ ! -d /etc/avahi/etc ]; then
99 mkdir -p @sysconfdir@/avahi/etc >/dev/null 2>&1
101 cp -fp /etc/localtime @sysconfdir@/avahi/etc >/dev/null 2>&1
108 # Function that stops the daemon/service.
112 [ $? != 0 ] && exit 0
118 # Function that reload the config file for the daemon/service.
122 [ $? != 0 ] && exit 0
128 # Function that check the status of the daemon/service.
132 [ $? = 0 ] && echo "$DESC is running" || echo "$DESC is not running"
137 log_begin_msg "Starting $DESC: $NAME"
142 log_begin_msg "Stopping $DESC: $NAME"
147 log_begin_msg "Refreshing $DESC: $NAME"
151 reload|restart|force-reload)
152 log_begin_msg "Restarting $DESC: $NAME"
161 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|reload}" >&2