# 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
}
# 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)
;;
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
;;