Difference between revisions of "Script variables"

From Amahi Wiki
Jump to: navigation, search
Line 1: Line 1:
Environment variables needed in scripts:
+
Here are some environment variables that are available to be used in app install scripts:
  
* HDA_APP_DIR: Directory of the webapp (basically, PWD)
+
* HDA_APP_DIR: Directory of the webapp
 
* HDA_IP: the internal IP of the HDA
 
* HDA_IP: the internal IP of the HDA
 
* HDA_APP_NAME: App name
 
* HDA_APP_NAME: App name
Line 8: Line 8:
 
* HDA_APP_PASSWORD: admin password (if available, otherwise undefined)
 
* HDA_APP_PASSWORD: admin password (if available, otherwise undefined)
 
* HDA_1ST_ADMIN: username of the 1st admin user
 
* HDA_1ST_ADMIN: username of the 1st admin user
 +
 +
== Examples ==
 +
 +
* Suppose the app needs to initialize the DB for an app with an initial admin user and password. The script could use <code>echo "insert .... '$HDA_APP_USERNAME' ..." </code>
 +
* Same thing with the domain name for this HDA.
 +
* Suppose there is a need to crete a directory for storing some file with a user name. The app install script could do <code>mkdir -p $HDA_1ST_ADMIN" </code>

Revision as of 21:35, 5 August 2012

Here are some environment variables that are available to be used in app install scripts:

  • HDA_APP_DIR: Directory of the webapp
  • HDA_IP: the internal IP of the HDA
  • HDA_APP_NAME: App name
  • HDA_DOMAIN: internal domain of this HDA
  • HDA_APP_USERNAME: admin username (if available, otherwise undefined)
  • HDA_APP_PASSWORD: admin password (if available, otherwise undefined)
  • HDA_1ST_ADMIN: username of the 1st admin user

Examples

  • Suppose the app needs to initialize the DB for an app with an initial admin user and password. The script could use echo "insert .... '$HDA_APP_USERNAME' ..."
  • Same thing with the domain name for this HDA.
  • Suppose there is a need to crete a directory for storing some file with a user name. The app install script could do mkdir -p $HDA_1ST_ADMIN"