Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # To work under crontab it must be used: chmod +x certs_update.sh
- P="/home/USER_NAME_HERE/unrealircd"
- U1="https://DOMAIN_NAME_HERE/fullchain.pem"
- U2="https://DOMAIN_NAME_HERE/privkey.pem"
- F1="fullchain.pem"
- F2="privkey.pem"
- if [ -f "$P/conf/certs/$F1" ]; then
- cp -v $P/conf/certs/$F1 $P/conf/certs/$F1.OLD
- fi ;
- if [ -f "$P/conf/certs/$F2" ]; then
- cp -v $P/conf/certs/$F2 $P/conf/certs/$F2.OLD
- fi ;
- curl "$U1" --output "$P/conf/certs/$F1"
- if [[ $? != 0 ]] ; then
- exit 1
- fi ;
- curl "$U2" --output "$P/conf/certs/$F2"
- if [[ $? != 0 ]] ; then
- exit 2
- fi ;
- $P/unrealircd rehash -tls
Add Comment
Please, Sign In to add comment