- change this script to one whose primary jobs is to generate the API
[myplc.git] / plc.d / api
1 #!/bin/bash
2 #
3 # priority: 450
4 #
5 # Configure the API. Must be done after SSL certificates are generated
6 # and before the API web server is brought up.
7 #
8 # Mark Huang <mlhuang@cs.princeton.edu>
9 # Copyright (C) 2006 The Trustees of Princeton University
10 #
11 # $Id: api,v 1.3 2006/04/25 21:18:19 mlhuang Exp $
12 #
13
14 # Source function library and configuration
15 . /etc/plc.d/functions
16 . /etc/planetlab/plc_config
17
18 # Be verbose
19 set -x
20
21 case "$1" in
22     start)
23         if [ "$PLC_API_ENABLED" != "1" ] ; then
24             exit 0
25         fi
26
27         MESSAGE=$"Configuring the API"
28         dialog "$MESSAGE"
29
30         api-config
31         check
32
33         result "$MESSAGE"
34         ;;
35 esac
36
37 exit $ERRORS