]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/initscripts/init.d/dnsmasq
1b2c0c206dc51eb04f0b4cc754bcf16742ceafd5
2 ########################################################################
3 # Begin $rc_base/init.d/dnsmasq
5 # Description : dnsmasq init script
7 # Authors : Michael Tremer - mitch@ipfire.org
13 ########################################################################
18 # Pull custom configuration file
19 if [ -e "/etc/sysconfig/dnsmasq" ]; then
20 .
/etc
/sysconfig
/dnsmasq
27 # kill already running copy of dnsmasq...
28 killproc
/usr
/sbin
/dnsmasq
2>&1 > /dev
/null
30 boot_mesg
"Starting Domain Name Service Proxy..."
32 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
34 [ "$DOMAIN_NAME_GREEN" != "" ] && ARGS
="-s $DOMAIN_NAME_GREEN"
36 echo > /var
/ipfire
/red
/resolv.conf
# Clear it
37 if [ -e "/var/ipfire/red/dns1" ]; then
38 DNS1
=$
(cat /var
/ipfire
/red
/dns1
2>/dev
/null
)
39 if [ ! -z ${DNS1} ]; then
40 echo "nameserver ${DNS1}" >> /var
/ipfire
/red
/resolv.conf
43 if [ -e "/var/ipfire/red/dns2" ]; then
44 DNS2
=$
(cat /var
/ipfire
/red
/dns2
2>/dev
/null
)
45 if [ ! -z ${DNS2} ]; then
46 echo "nameserver ${DNS2}" >> /var
/ipfire
/red
/resolv.conf
49 [ -e "/var/ipfire/red/active" ] && ARGS
="$ARGS -r /var/ipfire/red/resolv.conf"
51 ARGS
="$ARGS --domain=`cat /var/ipfire/main/settings |grep DOMAIN |cut -d = -f 2`"
52 ARGS
="$ARGS $CUSTOM_ARGS"
54 loadproc
/usr
/sbin
/dnsmasq
-l /var
/state
/dhcp
/dhcpd.leases
$ARGS
56 if [ "${SHOW_SRV}" -eq 1 ] && [ "${DNS1}" != "" -o "${DNS2}" != "" ]; then
57 boot_mesg
"Using DNS server(s): ${DNS1} ${DNS2}"
63 boot_mesg
"Stopping Domain Name Service Proxy..."
64 killproc
/usr
/sbin
/dnsmasq
74 statusproc
/usr
/sbin
/dnsmasq
78 echo "Usage: ${0} {start|stop|restart|status}"
83 # End $rc_base/init.d/dnsmasq