]> git.meshlink.io Git - catta/blob - initscript/archlinux/avahi-dnsconfd.in
667a0f62b3031b66468a5596ba021e3e16883cef
[catta] / initscript / archlinux / avahi-dnsconfd.in
1 #!/bin/bash
2
3 # $Id$
4
5 # This file is part of avahi.
6 #
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.
11 #
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.
16 #
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
20 # USA.
21
22 #
23 # Authors:      <lathiat@bur.st>
24 #
25
26
27 # general config
28 . /etc/rc.conf
29 . /etc/rc.d/functions
30
31 PATH=/sbin:/bin:/usr/sbin:/usr/bin
32 DESC="Avahi mDNS/DNS-SD DNS Server Configuration Daemon"
33 NAME="avahi-dnsconfd"
34 DAEMON="@sbindir@/$NAME"
35
36 case "$1" in
37     start)
38         stat_busy "Starting $DESC"
39         $DAEMON -D > /dev/null 2>&1
40         if [ $? -gt 0 ]; then
41             stat_fail
42         else
43             add_daemon $NAME
44             stat_done
45         fi
46         ;;
47     stop)
48         stat_busy "Stopping $DESC"
49         $DAEMON -k > /dev/null 2>&1
50         if [ $? -gt 0 ]; then
51             stat_fail
52         else
53             rm_daemon $NAME
54             stat_done
55         fi
56         ;;
57     restart)
58         $0 stop
59         $0 start
60         ;;
61     reload)
62         stat_busy "Reloading services for $DESC"
63         $DAEMON -r > /dev/null 2>&1
64         if [ $? -gt 0 ]; then
65             stat_fail
66         else
67             stat_done
68         fi
69         ;;
70     *)
71         echo "usage: $0 {start|stop|restart|reload}"
72         ;;
73 esac
74 exit 0