Skip to content

Instantly share code, notes, and snippets.

@RyanSquared
Last active December 17, 2019 04:23
Show Gist options
  • Save RyanSquared/0d4b1885feab9d294c17309a50b796fb to your computer and use it in GitHub Desktop.
Save RyanSquared/0d4b1885feab9d294c17309a50b796fb to your computer and use it in GitHub Desktop.
#!/bin/bash
set -eufo pipefail
user="$1"
logger "Handling user login $user"
psql "postgresql://ssh_auth:sheiJoh9chei7eezae9v@userdb-attempt-too-do-user-989073-0.db.ondigitalocean.com:25060/userdb?sslmode=require" \
-t --pset border=0 \
--set user="$user" \
<<< "select jsonb_array_elements_text(data->'ssh_keys') from passwd where passwd.name = :'user')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment