Last active
August 15, 2024 08:54
-
-
Save spangenberg/cd08ccb29983468cd92bb3f2387e8651 to your computer and use it in GitHub Desktop.
Rotate QNAP TLS Certificate with Tailscale cert
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
#!/bin/sh | |
mkdir -p /etc/stunnel/backup | |
cp --backup=number /etc/stunnel/backup.cert /etc/stunnel/backup.key /etc/stunnel/stunnel.pem /etc/stunnel/backup | |
$(getcfg -f /etc/config/qpkg.conf Tailscale Install_path)/tailscale cert --cert-file /etc/stunnel/backup.cert --key-file /etc/stunnel/backup.key $(dig @100.100.100.100 +noall +answer +short -x $($(getcfg -f /etc/config/qpkg.conf Tailscale Install_path)/tailscale ip -1) | sed 's/\.$//') | |
cat /etc/stunnel/backup.key /etc/stunnel/backup.cert > /etc/stunnel/stunnel.pem | |
/etc/init.d/thttpd.sh restart | |
/etc/init.d/stunnel.sh restart | |
/etc/init.d/Qthttpd.sh restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment