mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Merge pull request #1321 from DerDanilo/add_wireguard_persistentkeepalive
Add wireguard persistentkeepalive
This commit is contained in:
commit
c002031ce3
3 changed files with 12 additions and 0 deletions
|
@ -1129,6 +1129,13 @@ installPiVPN(){
|
||||||
echo "pivpnPROTO=${pivpnPROTO}" >> ${tempsetupVarsFile}
|
echo "pivpnPROTO=${pivpnPROTO}" >> ${tempsetupVarsFile}
|
||||||
echo "pivpnMTU=${pivpnMTU}" >> ${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
|
fi
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,4 +9,5 @@ pivpnPORT=51820
|
||||||
pivpnDNS1=9.9.9.9
|
pivpnDNS1=9.9.9.9
|
||||||
pivpnDNS2=149.112.112.112
|
pivpnDNS2=149.112.112.112
|
||||||
pivpnHOST=pivpn.example.com
|
pivpnHOST=pivpn.example.com
|
||||||
|
pivpnPERSISTENTKEEPALIVE=25
|
||||||
UNATTUPG=1
|
UNATTUPG=1
|
||||||
|
|
|
@ -120,6 +120,10 @@ PublicKey = $(cat keys/server_pub)
|
||||||
PresharedKey = $(cat "keys/${CLIENT_NAME}_psk")
|
PresharedKey = $(cat "keys/${CLIENT_NAME}_psk")
|
||||||
Endpoint = ${pivpnHOST}:${pivpnPORT}
|
Endpoint = ${pivpnHOST}:${pivpnPORT}
|
||||||
AllowedIPs = ${ALLOWED_IPS}" >> "configs/${CLIENT_NAME}.conf"
|
AllowedIPs = ${ALLOWED_IPS}" >> "configs/${CLIENT_NAME}.conf"
|
||||||
|
|
||||||
|
if [ -n "${pivpnPERSISTENTKEEPALIVE}" ]; then
|
||||||
|
echo "PersistentKeepalive = ${pivpnPERSISTENTKEEPALIVE}" >> "configs/${CLIENT_NAME}.conf"
|
||||||
|
fi
|
||||||
echo "::: Client config generated"
|
echo "::: Client config generated"
|
||||||
|
|
||||||
echo "### begin ${CLIENT_NAME} ###
|
echo "### begin ${CLIENT_NAME} ###
|
||||||
|
|
Loading…
Reference in a new issue