5 # Bootstrap the database
7 # Mark Huang <mlhuang@cs.princeton.edu>
8 # Copyright (C) 2006 The Trustees of Princeton University
10 # $Id: api,v 1.2 2006/04/10 16:00:47 mlhuang Exp $
13 # Source function library and configuration
14 . /etc/plc.d/functions
15 . /etc/planetlab/plc_config
17 # Export so that we do not have to specify -p to psql invocations
18 export PGPORT=$PLC_DB_PORT
22 if [ "$PLC_API_ENABLED" != "1" ] ; then
26 MESSAGE=$"Bootstrapping the database"
29 # Update the maintenance account username. This can't be
30 # done through the api-config script since it uses the
31 # maintenance account to access the API. The maintenance
32 # account should be person_id 1 since it is created by the
34 psql -U $PLC_DB_USER -c "UPDATE persons SET email='$PLC_API_MAINTENANCE_USER' WHERE person_id=1" $PLC_DB_NAME