Last active
April 20, 2021 01:02
-
-
Save wmantly/904fbdcd18aaae96d9f478a3e8581dd1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# William Mantly <[email protected]> | |
# MIT License | |
# https://github.com/wmantly | |
ME="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")" | |
if [ "$1" == "--help" ] || [ "$1" == "-h" ]; then | |
echo "Usage: $ME [domain] [cert]" | |
echo "Usage: $ME chat.theta42.com cert_pem" | |
echo "This will extract the cert and private key from the proxy for given domain" | |
echo "Valid cert options, only one at a time: 'cert_pem', 'expiry', 'fullchain_pem', 'privkey_pem'" | |
exit 0 | |
fi | |
if [ "$2" == "" ]; then | |
(>&2 echo "This command takes exactly 2 arguments. See $ME --help") | |
exit 1 | |
fi | |
redis-cli get "$1:latest" | python3 -c "import json; print( json.loads(input())['$2'] )" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment