diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2020-09-07 09:59:06 +0100 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2020-09-07 09:59:06 +0100 |
commit | 0ac9dd52b75a19e17098daa1c06a46fc7fa113e7 (patch) | |
tree | 07fd91d1de9a6743ae43748dd0e5f065fa82e600 /utility/trunc_and_populate.sh | |
parent | feb1b2963a1aedcf129a98b40e1d1cd9b7c83eea (diff) |
amended database scripts to accommidate linux and openbsd environments
Diffstat (limited to '')
-rwxr-xr-x | utility/trunc_and_populate.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/utility/trunc_and_populate.sh b/utility/trunc_and_populate.sh index 40c049b..dd89602 100755 --- a/utility/trunc_and_populate.sh +++ b/utility/trunc_and_populate.sh @@ -1,7 +1,13 @@ #!/usr/bin/env bash echo "Truncating the database." -sudo -u postgres psql -f utility/truncate_script.sql ctrack +if [[ "$OSTYPE" == "openbsd"* ]]; then + psql -U postgres -f utility/truncate_script.sql ctrack +elif [[ "$OSTYPE" == "linux-gnu"* ]]; then + sudo -u postgres psql -f utility/truncate_script.sql ctrack +else + echo "Cannot detect operating system" +fi sleep 1 |