aboutsummaryrefslogtreecommitdiffstats
path: root/utility/trunc_and_populate.sh
diff options
context:
space:
mode:
Diffstat (limited to 'utility/trunc_and_populate.sh')
-rwxr-xr-xutility/trunc_and_populate.sh8
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