X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=plc.d%2Fapi;h=c64937d506fc3a9ef10441cb61690c1db3b94568;hb=4458fbd2af168a6b1484538ec20e16c18c33b1ca;hp=08d58c2d192e8beb9c6a5bd73fdbb046107e93c6;hpb=c1ab1d87044b2859a9dd1d6419e2c9a14f2dae24;p=myplc.git diff --git a/plc.d/api b/plc.d/api index 08d58c2..c64937d 100755 --- a/plc.d/api +++ b/plc.d/api @@ -8,12 +8,13 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: api,v 1.4 2006/06/23 21:41:31 mlhuang Exp $ +# $Id$ # # Source function library and configuration . /etc/plc.d/functions . /etc/planetlab/plc_config +local_config=/etc/planetlab/configs/site.xml # Be verbose set -x @@ -27,29 +28,28 @@ case "$1" in MESSAGE=$"Configuring the API" dialog "$MESSAGE" - # Generate old DB configuration file - ln -sf plc_config /etc/planetlab/plc_db - # Make sure that the API maintenance account is protected by a # password. if [ -z "$PLC_API_MAINTENANCE_PASSWORD" ] ; then PLC_API_MAINTENANCE_PASSWORD=$(uuidgen) - plc-config --category=plc_api --variable=maintenance_password --value="$PLC_API_MAINTENANCE_PASSWORD" --save + plc-config --category=plc_api --variable=maintenance_password --value="$PLC_API_MAINTENANCE_PASSWORD" --save=$local_config $local_config + service plc reload fi # Make sure that all PLC servers are allowed to access the API # through the maintenance account. - PLC_API_MAINTENANCE_SOURCES=$( + PLC_API_MAINTENANCE_SOURCES=($(( + for ip in $PLC_API_MAINTENANCE_SOURCES ; do + echo $ip + done for server in API BOOT WWW ; do hostname=PLC_${server}_HOST gethostbyname ${!hostname} - done | sort -u - ) - plc-config --category=plc_api --variable=maintenance_sources --value="$PLC_API_MAINTENANCE_SOURCES" --save - - # Generate old API configuration file - api-config - check + done + ) | sort -u)) + PLC_API_MAINTENANCE_SOURCES=${PLC_API_MAINTENANCE_SOURCES[*]} + plc-config --category=plc_api --variable=maintenance_sources --value="$PLC_API_MAINTENANCE_SOURCES" --save=$local_config $local_config + service plc reload result "$MESSAGE" ;;