Softether with certbot

Create a script in your vps, change paths:



/root/vpnserver/vpnserver stop

/root/certbot/certbot-auto certonly --standalone --register-unsafely-without-email --non-interactive --agree-tos -d $DOMINIO --renew-hook "touch /tmp/newcert"

if [ -f /tmp/newcert ]; then

cert=$( sed '/----/d' /etc/letsencrypt/live/$DOMINIO/cert.pem | tr -d '
' )
key=$( sed '/----/d' /etc/letsencrypt/live/$DOMINIO/privkey.pem | tr -d '
' )

sed -i "s|byte ServerCert.*|byte ServerCert $cert|" /root/vpnserver/vpn_server.config
sed -i "s|byte ServerKey.*|byte ServerKey $key|" /root/vpnserver/vpn_server.config

rm /tmp/newcert


/root/vpnserver/vpnserver start

Put a cron, weekly.

Remember, if you use cert-based auth, you need to update it. If not, you're good to go :)

Top News