diff options
author | Mike Crute <mike@crute.us> | 2023-01-16 21:16:12 -0800 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2023-01-16 21:20:57 -0800 |
commit | d0dc85708bd7482685250352b39c5ae2174396c8 (patch) | |
tree | 388228bd019a6972addd59f6c2415ac2505d448c | |
parent | b4cbbad91c51da32ec247c9dfc3eaa6d01f8741c (diff) | |
download | dotfiles-d0dc85708bd7482685250352b39c5ae2174396c8.tar.bz2 dotfiles-d0dc85708bd7482685250352b39c5ae2174396c8.tar.xz dotfiles-d0dc85708bd7482685250352b39c5ae2174396c8.zip |
Add psql command
-rwxr-xr-x | bin/prod-psql.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/prod-psql.sh b/bin/prod-psql.sh new file mode 100755 index 0000000..6efae57 --- /dev/null +++ b/bin/prod-psql.sh | |||
@@ -0,0 +1,6 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | PASSWORD="$(vault.sh read --format=json database/static-creds/postgres-postgres | jq -r .data.password)" | ||
4 | DSN="postgresql://postgres:${PASSWORD}@postgres.sea4.crute.me:5432/postgres?sslmode=disable" | ||
5 | |||
6 | psql "${DSN}" | ||