X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=guest.init;h=c2e5aae9224fd17a80de73a326f1aa71342f933d;hb=e5acac6d6e8118faab76ac73cb2b8b10d89dd086;hp=d01b34567d72bb469ec01a2917436b10279ddf39;hpb=558da58c0398a2b9a5e17329ac3c1b9231190fb4;p=myplc.git diff --git a/guest.init b/guest.init index d01b345..c2e5aae 100755 --- a/guest.init +++ b/guest.init @@ -6,7 +6,7 @@ # # description: Manages all PLC services on this machine # -# $Id: guest.init,v 1.18 2006/06/23 21:48:41 mlhuang Exp $ +# $Id: guest.init,v 1.20 2006/08/08 23:19:52 mlhuang Exp $ # # Source function library and configuration @@ -33,15 +33,17 @@ nsteps=${#steps[@]} # Regenerate configuration files reload () { + force=$1 + # Regenerate the main configuration file from default values # overlaid with site-specific and current values. files=( /etc/planetlab/default_config.xml - /etc/planetlab/configs/* + /etc/planetlab/configs/*.xml /etc/planetlab/plc_config.xml ) for file in "${files[@]}" ; do - if [ $file -nt /etc/planetlab/plc_config.xml ] ; then + if [ -n "$force" -o $file -nt /etc/planetlab/plc_config.xml ] ; then tmp=$(mktemp /tmp/plc_config.xml.XXXXXX) plc-config --xml "${files[@]}" >$tmp if [ $? -eq 0 ] ; then @@ -56,10 +58,10 @@ reload () done # Convert configuration to various formats - if [ /etc/planetlab/plc_config.xml -nt /etc/planetlab/plc_config ] ; then + if [ -n "$force" -o /etc/planetlab/plc_config.xml -nt /etc/planetlab/plc_config ] ; then plc-config --shell >/etc/planetlab/plc_config fi - if [ /etc/planetlab/plc_config.xml -nt /etc/planetlab/php/plc_config.php ] ; then + if [ -n "$force" -o /etc/planetlab/plc_config.xml -nt /etc/planetlab/php/plc_config.php ] ; then mkdir -p /etc/planetlab/php plc-config --php >/etc/planetlab/php/plc_config.php fi @@ -117,7 +119,7 @@ command=$1 shift 1 if [ -z "$1" ] ; then # Start or stop everything. Regenerate configuration first. - reload + reload force else # Start or stop a particular step steps=("$@") @@ -166,6 +168,7 @@ case "$command" in ;; reload) + reload force ;; *)