bootup.sh 1.0 KB

1234567891011121314151617181920212223242526
  1. #!/bin/bash -e
  2. /etc/init.d/postgresql start
  3. FILE=/has-user
  4. if test -f "$FILE"; then
  5. echo ""
  6. else
  7. #su postgres -c 'psql -c"CREATE USER admin WITH PASSWORD '\''Innovat10n'\'' CREATEDB; " '
  8. su postgres -c 'psql -c"CREATE USER $PG_USER WITH PASSWORD '\''$PG_PASSWORD'\'' CREATEDB; " '
  9. echo "user has been created" > /has-user
  10. createdb healthcareio -U$PG_USER
  11. #
  12. # by default we will export the data to x-healthcareio
  13. #
  14. createdb x-healthcareio -U$PG_USER
  15. mkdir $HOME/.healthcareio
  16. echo '{"username":"'$PG_USER'","host":"127.0.0.1"}' > $HOME/.healthcareio/auth-file.json
  17. echo '{"database":"x-healthcareio","provider":"postgresql","username":"'$PG_USER'","host":"127.0.0.1"}' > $HOME/.healthcareio/export-file.json
  18. healthcare-io init $USER_EMAIL --provider postgresql --auth-file $HOME/.healthcareio/auth-file.json
  19. #
  20. # starting the database ui on port 8081
  21. /apps/pgweb_linux_amd64 --listen 5000 --bind 0.0.0.0 --user $PG_USER --host 127.0.0.1 --db x-healthcareio
  22. fi
  23. bash