From: Mark Huang Date: Mon, 10 Apr 2006 21:09:02 +0000 (+0000) Subject: - must read /etc/planetlab/plc_config.xml, otherwise changes will always X-Git-Tag: myplc-0_4-rc1~78 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=d73a1a4d14d1546581d3b71b1ae0ded70a373fc2;p=myplc.git - must read /etc/planetlab/plc_config.xml, otherwise changes will always be lost! --- diff --git a/guest.init b/guest.init index 6c061a7..f931519 100755 --- a/guest.init +++ b/guest.init @@ -6,7 +6,7 @@ # # description: Manages all PLC services on this machine # -# $Id: guest.init,v 1.13 2006/04/06 21:51:59 mlhuang Exp $ +# $Id: guest.init,v 1.14 2006/04/10 18:18:14 mlhuang Exp $ # # Source function library and configuration @@ -34,11 +34,20 @@ nsteps=${#steps[@]} reload () { # Regenerate the main configuration file from default values - # overlaid with site-specific values. + # overlaid with site-specific and current values. + tmp=$(mktemp /tmp/plc_config.xml.XXXXXX) plc-config --xml \ /etc/planetlab/default_config.xml \ /etc/planetlab/configs/* \ - >/etc/planetlab/plc_config.xml + /etc/planetlab/plc_config.xml \ + >$tmp + if [ $? -eq 0 ] ; then + mv $tmp /etc/planetlab/plc_config.xml + chmod 644 /etc/planetlab/plc_config.xml + else + echo "PLC: Warning: Invalid configuration file(s) detected" + rm -f $tmp + fi # Shell constants plc-config --shell >/etc/planetlab/plc_config