b819e32be053d663c30712454b3e16160f0fa0b6
[myplc.git] / plc.d / dns
1 #!/bin/bash
2 #
3 # priority: 850
4 #
5 # Start local DNS server to provide minimal DNS forward resolution for
6 # ourselves and our nodes.
7 #
8 # Mark Huang <mlhuang@cs.princeton.edu>
9 # Copyright (C) 2006 The Trustees of Princeton University
10 #
11 # $Id$
12 #
13
14 # Source function library and configuration
15 . /etc/plc.d/functions
16 . /etc/planetlab/plc_config
17
18 # Be verbose
19 set -x
20
21 case "$1" in
22     start)
23         [ $PLC_DNS_ENABLED -ne 1 ] && exit 0
24
25         MESSAGE=$"Starting DNS server"
26         dialog "$MESSAGE"
27
28         dns-config
29         check
30
31         plc_daemon dnsmasq
32         check
33
34         result "$MESSAGE"
35         ;;
36
37     stop)
38         [ $PLC_DNS_ENABLED -ne 1 ] && exit 0
39         MESSAGE=$"Stopping DNS server"
40         dialog "$MESSAGE"
41
42         killproc plc_dnsmasq
43         check
44
45         result "$MESSAGE"
46         ;;
47 esac
48
49 exit $ERRORS