From 63733b44a59fb448f21fae5b0866c0102dcc4e6d Mon Sep 17 00:00:00 2001 From: Orazio Date: Sat, 3 Oct 2020 10:20:40 +0200 Subject: [PATCH] Reload WireGuard instead of restarting so it doesn't kick existing clients --- scripts/wireguard/makeCONF.sh | 6 +++--- scripts/wireguard/removeCONF.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/wireguard/makeCONF.sh b/scripts/wireguard/makeCONF.sh index e0669b8..0564fb5 100755 --- a/scripts/wireguard/makeCONF.sh +++ b/scripts/wireguard/makeCONF.sh @@ -130,10 +130,10 @@ if [ -f /etc/pivpn/hosts.wireguard ]; then fi fi -if systemctl restart wg-quick@wg0; then - echo "::: WireGuard restarted" +if systemctl reload wg-quick@wg0; then + echo "::: WireGuard reloaded" else - echo "::: Failed to restart WireGuard" + echo "::: Failed to reload WireGuard" fi cp "configs/${CLIENT_NAME}.conf" "${install_home}/configs/${CLIENT_NAME}.conf" diff --git a/scripts/wireguard/removeCONF.sh b/scripts/wireguard/removeCONF.sh index cbf4dbb..6a9c6ab 100755 --- a/scripts/wireguard/removeCONF.sh +++ b/scripts/wireguard/removeCONF.sh @@ -136,9 +136,9 @@ done # Restart WireGuard only if some clients were actually deleted if [ "${DELETED_COUNT}" -gt 0 ]; then - if systemctl restart wg-quick@wg0; then - echo "::: WireGuard restarted" + if systemctl reload wg-quick@wg0; then + echo "::: WireGuard reloaded" else - echo "::: Failed to restart WireGuard" + echo "::: Failed to reload WireGuard" fi fi