1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2007-2012 OpenWrt.org
4 # version 20090401 jhalfmoon
7 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
8 DAEMON=/usr/bin/tinydns
10 DESC="Authoritative nameserver"
15 echo "Starting $DESC: $NAME"
17 config_foreach get_userids global
19 ln -sf /etc/tinydns/data $ROOT/data
22 chown -R $UID:$GID $ROOT
23 config_foreach start_daemon tinydns
28 config_get UID "$cfg" runasuser
29 config_get GID "$cfg" runasgroup
36 config_get logging "$cfg" logging
37 config_get iface "$cfg" interface
38 # Translate listening interfaces to ip addresses
39 . /lib/functions/network.sh
40 network_get_ipaddr IP "$iface"
42 if [ "$DEBUG" == 1 ] ; then
44 elif [ "$logging" == '1' ] ; then
45 $DAEMON 2>&1 | logger -p local1.info -t $NAME &
47 $DAEMON > /dev/null 2>&1 &
52 echo -n "Stopping $DESC: $NAME"
53 kill `pidof $NAME|sed "s/$$//g"` > /dev/null 2>&1
58 echo "Restarting $DESC: $NAME... "