Skip to content

Commit

Permalink
Update service.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuler authored Sep 20, 2024
1 parent 0595b68 commit 4a61e80
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions allinone/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ function init_pg() {
return
fi

if [[ ! -f /var/lib/postgresql/13/main/inited.txt ]];then
sudo -u postgres psql -c "ALTER USER postgres PASSWORD '$DB_PASSWORD';"
sudo -u postgres psql -c "CREATE DATABASE $DB_NAME;"
touch /var/lib/postgresql/13/main/inited.txt
fi

echo ">> Start database postgre"
chown -R postgres:postgres /var/lib/postgresql/13/main
pg_ctlcluster 13 main start
sleep 3

if [[ ! -f /var/lib/postgresql/13/main/inited.txt ]];then
sudo -u postgres psql -c "ALTER USER postgres PASSWORD '$DB_PASSWORD';"
sudo -u postgres psql -c "CREATE DATABASE $DB_NAME;"
touch /var/lib/postgresql/13/main/inited.txt
fi
}

function init_ng(){
Expand Down

0 comments on commit 4a61e80

Please sign in to comment.