]> git.meshlink.io Git - catta/blobdiff - initscript/debian/avahi-daemon.in
log end_msg for debian initscript
[catta] / initscript / debian / avahi-daemon.in
index e942785a7e611d36f68c276aadef8e685a0100b5..3a68781f8b7a5fc6db3e2d6c900ff84475bb8010 100755 (executable)
@@ -91,8 +91,9 @@ test -x $DAEMON || exit 0
 #       Function that starts the daemon/service.
 #
 d_start() {
-    $DAEMON -c
-    [ $? = 0 ] && exit 0
+    modprobe capability >/dev/null 2>&1 || true
+
+    $DAEMON -c && return 0
 
     if [ -s /etc/localtime ]; then
        if [ ! -d /etc/avahi/etc ]; then
@@ -108,28 +109,21 @@ d_start() {
 #       Function that stops the daemon/service.
 #
 d_stop() {
-    $DAEMON -c
-    [ $? != 0 ] && exit 0
-
-    $DAEMON -k
+    $DAEMON -c && $DAEMON -k
 }
 
 #
 #       Function that reload the config file for the daemon/service.
 #
 d_reload() {
-    $DAEMON -c
-    [ $? != 0 ] && exit 0
-
-    $DAEMON -r
+    $DAEMON -c && $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"
+    $DAEMON -c && echo "$DESC is running" || echo "$DESC is not running"
 }
 
 case "$1" in
@@ -150,7 +144,7 @@ case "$1" in
         ;;
     restart|force-reload)
         log_begin_msg "Restarting $DESC: $NAME"
-        d_stop
+        $DAEMON -c && d_stop
         d_start
         log_end_msg $?
         ;;