X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc.d%2Fapi;fp=plc.d%2Fapi;h=d015bc623b66fc9969a3b3707ca86a8ecbdf4ef3;hb=106e14d7f661da956715e6898cbfeff512744b28;hp=7f90de6ac8ce5e36cf7b546e337505a54e427c06;hpb=ef7a909a625a7f643c5fc78afac5c6150a265252;p=myplc.git diff --git a/plc.d/api b/plc.d/api index 7f90de6..d015bc6 100755 --- a/plc.d/api +++ b/plc.d/api @@ -8,7 +8,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: api,v 1.3 2006/04/25 21:18:19 mlhuang Exp $ +# $Id: api,v 1.5 2006/07/10 21:08:06 mlhuang Exp $ # # Source function library and configuration @@ -27,6 +27,27 @@ 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 + fi + + # Make sure that all PLC servers are allowed to access the API + # through the maintenance account. + PLC_API_MAINTENANCE_SOURCES=$( + 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