aboutsummaryrefslogtreecommitdiff
path: root/sql/doall.sh
blob: 89594f846636f8829a2539b7d07a1c0f303fca44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
PATH=/opt/homebrew/Cellar/postgresql@16/16.2_1/bin:$PATH
brew services start postgresql@16
rm -f $HOME/.db.pgdump
wget $1 -O $HOME/.db.pgdump
dropdb --if-exists derpibooru
#sudo -u postgres dropdb --if-exists derpibooru
createdb derpibooru
#sudo -u postgres createdb derpibooru
pg_restore -v -O -d derpibooru $HOME/.db.pgdump
#sudo -u postgres pg_restore -v -O -d derpibooru $HOME/.db.pgdump
python3 main.py
#sudo -u postgres bash -c "cd $PATH && python3 main.py"
brew services stop postgresql@16
rm -f $HOME/.db.pgdump