Skip to content

Instantly share code, notes, and snippets.

@crizstian
Created April 12, 2019 18:51
Show Gist options
  • Save crizstian/c0f7d0a50ba63324acaa025d52519c80 to your computer and use it in GitHub Desktop.
Save crizstian/c0f7d0a50ba63324acaa025d52519c80 to your computer and use it in GitHub Desktop.
DB_HOST=`echo ${hostname} | sed -e 's/ip-//'`
IP=`ip -f inet addr show eth0 | grep -Po 'inet \K[\d.]+'`
DB_PORT=27017
BOOKSTORE_DBUSER=bookstore
BOOKSTORE_DBPASS=bookstorepass1
CINEMA_DBUSER=cinemas
CINEMA_DBPASS=cinemaspass1
echo "export DB_HOST=${DB_HOST}" >> /etc/environment
echo "export IP=${IP}" >> /etc/environment
echo "export DB_PORT=${DB_PORT}" >> /etc/environment
echo "export BOOKSTORE_DBUSER=${BOOKSTORE_DBUSER}" >> /etc/environment
echo "export BOOKSTORE_DBPASS=${BOOKSTORE_DBPASS}" >> /etc/environment
echo "export CINEMA_DBUSER=${CINEMA_DBUSER}" >> /etc/environment
echo "export CINEMA_DBPASS=${CINEMA_DBPASS}" >> /etc/environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment