forked from Stinocon/PlexSSLAutorenew
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplexrenew.sh
More file actions
17 lines (17 loc) · 842 Bytes
/
plexrenew.sh
File metadata and controls
17 lines (17 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
#https://github.com/Stinocon/PlexSSLAutorenew/
#Change your.public.domain with the folder automatically generated by certbot that was created at the first manual certificate generation
cd /etc/letsencrypt/live/your.public.domain/
certbot renew
/usr/bin/expect <(cat << EOF
spawn openssl pkcs12 -export -out /etc/letsencrypt/live/your.public.domain/certificate.pfx -inkey /etc/letsencrypt/live/your.public.domain/privkey.pem -in /etc/letsencrypt/live/your.public.domain/cert.pem -certfile /etc/letsencrypt/live/your.public.domain/chain.pem
expect "Enter Export Password:"
send "\r"
expect "Verifying - Enter Export Password:"
send "\r"
interact
EOF
)
mv /etc/letsencrypt/live/your.public.domain/certificate.pfx /var/lib/plexmediaserver
chown plex:plex /var/lib/plexmediaserver/certificate.pfx
service plexmediaserver restart