Reload WireGuard instead of restarting so it doesn't kick existing clients

This commit is contained in:
Orazio 2020-10-03 10:20:40 +02:00
parent 77e75829ea
commit 63733b44a5
2 changed files with 6 additions and 6 deletions

View file

@ -130,10 +130,10 @@ if [ -f /etc/pivpn/hosts.wireguard ]; then
fi fi
fi fi
if systemctl restart wg-quick@wg0; then if systemctl reload wg-quick@wg0; then
echo "::: WireGuard restarted" echo "::: WireGuard reloaded"
else else
echo "::: Failed to restart WireGuard" echo "::: Failed to reload WireGuard"
fi fi
cp "configs/${CLIENT_NAME}.conf" "${install_home}/configs/${CLIENT_NAME}.conf" cp "configs/${CLIENT_NAME}.conf" "${install_home}/configs/${CLIENT_NAME}.conf"

View file

@ -136,9 +136,9 @@ done
# Restart WireGuard only if some clients were actually deleted # Restart WireGuard only if some clients were actually deleted
if [ "${DELETED_COUNT}" -gt 0 ]; then if [ "${DELETED_COUNT}" -gt 0 ]; then
if systemctl restart wg-quick@wg0; then if systemctl reload wg-quick@wg0; then
echo "::: WireGuard restarted" echo "::: WireGuard reloaded"
else else
echo "::: Failed to restart WireGuard" echo "::: Failed to reload WireGuard"
fi fi
fi fi