1234567891011121314151617181920212223242526 |
- #!/bin/bash -e
- /etc/init.d/postgresql start
- FILE=/has-user
- if test -f "$FILE"; then
- echo ""
- else
- #su postgres -c 'psql -c"CREATE USER admin WITH PASSWORD '\''Innovat10n'\'' CREATEDB; " '
- su postgres -c 'psql -c"CREATE USER $PG_USER WITH PASSWORD '\''$PG_PASSWORD'\'' CREATEDB; " '
- echo "user has been created" > /has-user
- createdb healthcareio -U$PG_USER
- #
- # by default we will export the data to x-healthcareio
- #
- createdb x-healthcareio -U$PG_USER
- mkdir $HOME/.healthcareio
- echo '{"username":"'$PG_USER'","host":"127.0.0.1"}' > $HOME/.healthcareio/auth-file.json
- echo '{"database":"x-healthcareio","provider":"postgresql","username":"'$PG_USER'","host":"127.0.0.1"}' > $HOME/.healthcareio/export-file.json
- healthcare-io init $USER_EMAIL --provider postgresql --auth-file $HOME/.healthcareio/auth-file.json
- #
- # starting the database ui on port 8081
- /apps/pgweb_linux_amd64 --listen 5000 --bind 0.0.0.0 --user $PG_USER --host 127.0.0.1 --db x-healthcareio
- fi
- bash
|