Merge pull request #1321 from DerDanilo/add_wireguard_persistentkeepalive

Add wireguard persistentkeepalive
This commit is contained in:
Orazio 2021-06-23 10:17:47 +02:00 committed by GitHub
commit c002031ce3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View file

@ -1129,6 +1129,13 @@ installPiVPN(){
echo "pivpnPROTO=${pivpnPROTO}" >> ${tempsetupVarsFile}
echo "pivpnMTU=${pivpnMTU}" >> ${tempsetupVarsFile}
# Write PERSISTENTKEEPALIVE if provided via unattended file
# May also be added manually to /etc/pivpn/wireguard/setupVars.conf
# post installation to be used for client profile generation
if [ "$pivpnPERSISTENTKEEPALIVE" ]; then
echo "pivpnPERSISTENTKEEPALIVE=${pivpnPERSISTENTKEEPALIVE}" >> ${tempsetupVarsFile}
fi
fi
{

View file

@ -9,4 +9,5 @@ pivpnPORT=51820
pivpnDNS1=9.9.9.9
pivpnDNS2=149.112.112.112
pivpnHOST=pivpn.example.com
pivpnPERSISTENTKEEPALIVE=25
UNATTUPG=1

View file

@ -120,6 +120,10 @@ PublicKey = $(cat keys/server_pub)
PresharedKey = $(cat "keys/${CLIENT_NAME}_psk")
Endpoint = ${pivpnHOST}:${pivpnPORT}
AllowedIPs = ${ALLOWED_IPS}" >> "configs/${CLIENT_NAME}.conf"
if [ -n "${pivpnPERSISTENTKEEPALIVE}" ]; then
echo "PersistentKeepalive = ${pivpnPERSISTENTKEEPALIVE}" >> "configs/${CLIENT_NAME}.conf"
fi
echo "::: Client config generated"
echo "### begin ${CLIENT_NAME} ###