X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=initscript%2Fdebian%2Favahi-dnsconfd.in;h=c7cbf05fa804204013e2c1a636cef52fcd365a8e;hb=c1e5b725e8e769c8ac1f5df97aac53896b05af43;hp=0720a9e76a7a052740ed4dbc0af0912d25bc4ad2;hpb=af1ba2749a5430dac57b5d46929f0159ef8d2fb8;p=catta diff --git a/initscript/debian/avahi-dnsconfd.in b/initscript/debian/avahi-dnsconfd.in index 0720a9e..c7cbf05 100755 --- a/initscript/debian/avahi-dnsconfd.in +++ b/initscript/debian/avahi-dnsconfd.in @@ -91,6 +91,16 @@ test -x $DAEMON || exit 0 # Function that starts the daemon/service. # d_start() { + $DAEMON -c + [ $? = 0 ] && exit 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 +108,29 @@ d_start() { # Function that stops the daemon/service. # d_stop() { - $DAEMON -k || /bin/true + $DAEMON -c + [ $? != 0 ] && exit 0 + + $DAEMON -k } # # Function that reload the config file for the daemon/service. # d_refresh() { + $DAEMON -c + [ $? != 0 ] && exit 0 + $DAEMON -r } +# +# Function that check the status of the daemon/service. +# +d_status() { + $DAEMON -c + [ $? = 0 ] && echo "$DESC is running" || echo "$DESC is not running" +} case "$1" in start) @@ -127,11 +150,14 @@ case "$1" in ;; reload|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 ;;