X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc.d%2Fdns;h=afdf55ffd4ad5fcfa26d512cad2eef0a6db16a90;hb=039b8b04f1e3e9f584abf83797ae3f1a8c421e23;hp=b1958094d710c6c402a09471d5ed1d6e51b8d479;hpb=11f03096d5b8ca4b1b4e407c679c47fd33242b62;p=myplc.git diff --git a/plc.d/dns b/plc.d/dns index b195809..afdf55f 100755 --- a/plc.d/dns +++ b/plc.d/dns @@ -1,6 +1,6 @@ #!/bin/bash # -# priority: 850 +# priority: 950 # # Start local DNS server to provide minimal DNS forward resolution for # ourselves and our nodes. @@ -8,14 +8,12 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id$ -# # Source function library and configuration . /etc/plc.d/functions . /etc/planetlab/plc_config -SIGNATURE="; generated by /etc/plc.d/dns --- DO NOT REMOVE THIS TEXT!" +SIGNATURE="; generated by /etc/plc.d/dns --- DO NOT REMOVE THIS TEXT" # Be verbose set -x @@ -23,7 +21,7 @@ set -x case "$1" in start) if [ $PLC_DNS_ENABLED -eq 1 ] ; then - MESSAGE=$"Starting DNS server" + MESSAGE="Starting DNS server" dialog "$MESSAGE" dns-config @@ -32,7 +30,7 @@ case "$1" in # Set up nameservers if [ -n "$PLC_NET_DNS1" -o -n "$PLC_NET_DNS2" ] ; then - MESSAGE=$"Configuring resolv.conf" + MESSAGE="Configuring resolv.conf" dialog "$MESSAGE" rfile=$(mktemp) @@ -63,9 +61,9 @@ case "$1" in ;; stop) - MESSAGE=$"Reverting /etc/resolv.conf and /etc/hosts" - dialog "$MESSAGE" if [ $PLC_DNS_ENABLED -eq 1 ] ; then + MESSAGE=$"Reverting /etc/resolv.conf" + dialog "$MESSAGE" if [ -f "/etc/plc_resolv.conf" ] ; then ourfile=$(grep "$SIGNATURE" /etc/plc_resolv.conf| wc -l) if [ $ourfile -ne 0 ] ; then @@ -73,21 +71,28 @@ case "$1" in fi mv -f /etc/plc_resolv.conf /etc/resolv.conf fi + check + result "" + MESSAGE=$"Removing /etc/plc_hosts" + dialog "$MESSAGE" [ -f "/etc/plc_hosts" ] && rm -f /etc/plc_hosts + result "" fi if [ $PLC_DNS_ENABLED -eq 0 -a -f "/etc/resolv_plc.backup" ] ; then + MESSAGE="Restoring /etc/resolv.conf" + dialog "$MESSAGE" mv -f /etc/resolv_plc.backup /etc/resolv.conf + result "" fi if [ $PLC_DNS_ENABLED -eq 1 ] ; then - MESSAGE=$"Stopping DNS server" + MESSAGE="Stopping DNS server" dialog "$MESSAGE" - killproc plc_dnsmasq check + result "" fi - result "$MESSAGE" ;; esac