Browse Source

refactor: change for all strings ' to "

master
bucde 3 years ago
parent
commit
7e73853c96
1 changed files with 29 additions and 29 deletions
  1. +29
    -29
      setup

+ 29
- 29
setup View File

@ -1,39 +1,39 @@
#!/bin/bash #!/bin/bash
echo '####################################################################'
echo '# docker_postgres_setup_script #'
echo '# Dennis Buchhorn - bucde@b-eit.de #'
echo '####################################################################'
echo '# WARNING: password is plain text input! #'
echo '# #'
echo "####################################################################"
echo "# docker_postgres_setup_script #"
echo "# Dennis Buchhorn - bucde@b-eit.de #"
echo "####################################################################"
echo "# WARNING: password is plain text input! #"
echo "# #"
echo "# Config will be saved in '.env' file. #" echo "# Config will be saved in '.env' file. #"
echo '# (everything in plain text, even the password) #'
#echo '# #'
echo '####################################################################'
echo ''
echo "# (everything in plain text, even the password) #"
#echo "# #"
echo "####################################################################"
echo ""
CONFIG_EXISTS='false'
KEEP_CONFIG=''
CONFIG_EXISTS="false"
KEEP_CONFIG=""
POSTGRES_VERSION=''
POSTGRES_HOST_IP_ADDRESS=''
POSTGRES_HOST_PORT=''
POSTGRES_ADMIN_USER=''
POSTGRES_ADMIN_PASSWORD=''
POSTGRES_VERSION=""
POSTGRES_HOST_IP_ADDRESS=""
POSTGRES_HOST_PORT=""
POSTGRES_ADMIN_USER=""
POSTGRES_ADMIN_PASSWORD=""
POSTGRES_SHARED_HOSTING=''
POSTGRES_SHARED_HOSTING=""
if [ -f ".env" ]; then if [ -f ".env" ]; then
CONFIG_EXISTS='true'
CONFIG_EXISTS="true"
read -p "Config file '.env' already exists! Would you like to use this? (y/n)" KEEP_CONFIG read -p "Config file '.env' already exists! Would you like to use this? (y/n)" KEEP_CONFIG
fi fi
if [ $CONFIG_EXISTS == 'false' ] || [ $KEEP_CONFIG == 'n' ]; then
read -p 'Enter postgres version which should be used: ' POSTGRES_VERSION
read -p 'Enter host (vm) ip address on which postgres should be accessible: ' POSTGRES_HOST_IP_ADDRESS
read -p 'Enter host (vm) port on which postgres should be accessible: ' POSTGRES_HOST_PORT
read -p 'Enter admin user name for postgres: ' POSTGRES_ADMIN_USER
read -p 'Enter admin password for postgres: ' POSTGRES_ADMIN_PASSWORD
if [ $CONFIG_EXISTS == "false" ] || [ $KEEP_CONFIG == "n" ]; then
read -p "Enter postgres version which should be used: " POSTGRES_VERSION
read -p "Enter host (vm) ip address on which postgres should be accessible: " POSTGRES_HOST_IP_ADDRESS
read -p "Enter host (vm) port on which postgres should be accessible: " POSTGRES_HOST_PORT
read -p "Enter admin user name for postgres: " POSTGRES_ADMIN_USER
read -p "Enter admin password for postgres: " POSTGRES_ADMIN_PASSWORD
rm -f .env rm -f .env
touch .env touch .env
@ -50,15 +50,15 @@ else
done < ".env" done < ".env"
fi fi
read -p 'Would you like to modify postgres rights for shared hosting? (y/n)' POSTGRES_SHARED_HOSTING
read -p "Would you like to modify postgres rights for shared hosting? (y/n)" POSTGRES_SHARED_HOSTING
docker-compose up -d docker-compose up -d
echo 'Wait a few seconds for the container to spin up ...'
echo "Wait a few seconds for the container to spin up ..."
sleep 5 sleep 5
if [ $POSTGRES_SHARED_HOSTING == 'y' ]; then
if [ $POSTGRES_SHARED_HOSTING == "y" ]; then
touch tmp touch tmp
echo "REVOKE ALL ON DATABASE template1 FROM public;" >> tmp echo "REVOKE ALL ON DATABASE template1 FROM public;" >> tmp
echo "REVOKE ALL ON SCHEMA public FROM public;" >> tmp echo "REVOKE ALL ON SCHEMA public FROM public;" >> tmp
@ -77,4 +77,4 @@ if [ $POSTGRES_SHARED_HOSTING == 'y' ]; then
rm -f tmp rm -f tmp
fi fi
echo 'Done!'
echo "Done!"

Loading…
Cancel
Save