Created
January 17, 2021 20:39
-
-
Save mtholder/1c7b597751bcf8f32a543eeee414b7b8 to your computer and use it in GitHub Desktop.
client-push-new-cert.sh
This file contains 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
#!/bin/bash | |
n="$1" | |
if test -z $n ; then | |
echo "Expecting a machine name for the opentreeoflife.org domain as first arg" | |
exit 1 | |
fi | |
if test -z $2 ; then | |
u=admin | |
else | |
u="${2}" | |
fi | |
echo "copying check_letsencrypt_file_perms.py to ${u}@${n}.opentreeoflife.org:~/" | |
scp check_letsencrypt_file_perms.py "${u}@${n}.opentreeoflife.org:~/check_letsencrypt_file_perms.py" || exit | |
echo "copying renewed-letsencrypt.tgz to ${u}@${n}.opentreeoflife.org~/secrets/" | |
scp renewed-letsencrypt.tgz "${u}@${n}.opentreeoflife.org:~/secrets/renewed-letsencrypt.tgz" || exit | |
echo "copying server-side-renew-certs.bash to ${u}@${n}.opentreeoflife.org~/secrets/" | |
scp server-side-renew-certs.bash "${u}@${n}.opentreeoflife.org:~/secrets/server-side-renew-certs.bash" || exit | |
echo "executing server-side-renew-certs.bash on ${u}@${n}.opentreeoflife.org~/secrets/" | |
ssh "${u}@${n}.opentreeoflife.org" "bash secrets/server-side-renew-certs.bash" || exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment