diff options
Diffstat (limited to 'utility/drop_and_recreate.sh')
-rwxr-xr-x | utility/drop_and_recreate.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/utility/drop_and_recreate.sh b/utility/drop_and_recreate.sh index 89734f4..5adf06b 100755 --- a/utility/drop_and_recreate.sh +++ b/utility/drop_and_recreate.sh @@ -2,6 +2,14 @@ echo "Ensure this is run from project root." echo "Dropping database..." -sudo -u postgres psql -f utility/drop_and_recreate.sql -echo "Done." +if [[ "$OSTYPE" == "openbsd"* ]]; then + #doas -u _postgresql psql -f utility/drop_and_recreate.sql + psql -U postgres -f utility/drop_and_recreate.sql +elif [[ "$OSTYPE" == "linux-gnu"* ]]; then + sudo -u postgres psql -f utility/drop_and_recreate.sql +else + echo "Cannot detect operating system" +fi + +echo "Done." |