ac639e40c28675ae33819dd3ced17cc881bd0375
[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: dns,v 1.1 2006/05/23 18:10:08 mlhuang Exp $
12 #
13
14 # Source function library and configuration
15 . /etc/plc.d/functions
16 . /etc/planetlab/plc_config
17
18 case "$1" in
19     start)
20         if [ "$PLC_DNS_ENABLED" != "1" ] ; then
21             exit 0
22         fi
23
24         MESSAGE=$"Starting DNS server"
25         dialog "$MESSAGE"
26
27         dns-config
28         check
29
30         plc_daemon dnsmasq
31         check
32
33         result "$MESSAGE"
34         ;;
35
36     stop)
37         MESSAGE=$"Stopping DNS server"
38         dialog "$MESSAGE"
39
40         killproc plc_dnsmasq
41         check
42
43         result "$MESSAGE"
44         ;;
45 esac
46
47 exit $ERRORS