Created
February 8, 2020 21:18
-
-
Save RalphORama/919b7caa3dec80dc0fe3c1861d0d871e to your computer and use it in GitHub Desktop.
Script for generating a pcks12 Java keystore for Plan Player Analytics
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 | |
# This script will generate a keystore for use with Plan | |
# https://www.spigotmc.org/resources/plan-player-analytics.32536/ | |
# After running the script, plug in the details as follows: | |
# KeyStore_path: the path you specified | |
# Key_pass: the password you specified | |
# Store_pass: the same password as Key_pass | |
# Alias: plan | |
USAGE="Usage: $0 <domain> <keystore password> [keystore filename]" | |
if [ -z "$1" ] || [ -z "$2" ]; then | |
echo "$USAGE" | |
exit 1 | |
fi | |
[ -z "$3" ] && KEYSTORE_FILE="Cert.jks" || KEYSTORE_FILE="$3" | |
echo "$KEYSTORE_FILE" | |
/usr/bin/openssl pkcs12 -export \ | |
-in "/etc/letsencrypt/live/$1/fullchain.pem" \ | |
-inkey "/etc/letsencrypt/live/$1/privkey.pem" \ | |
-out "$KEYSTORE_FILE" \ | |
-name "plan" \ | |
-passout pass:"$2" \ | |
-passin pass:"$2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment