Open WorkTimer opened 3 months ago
I propose replacing the systemctl restart wg-quick@wg0.service command with wg syncconf wg0 in the service execution command. This change aims to prevent network disruptions during the reconfiguration process. Here's the suggested modification: Replace: ExecStart=/usr/bin/systemctl restart wg-quick@wg0.service With: ExecStart=/bin/sh -c 'grep -v -e "^Address = " -e "MTU = " -e "PostUp = " -e "PreDown = " -e "PostDown = " -e "Table = " /etc/wireguard/wg0.conf | wg syncconf wg0 /dev/stdin'
ExecStart=/usr/bin/systemctl restart wg-quick@wg0.service
ExecStart=/bin/sh -c 'grep -v -e "^Address = " -e "MTU = " -e "PostUp = " -e "PreDown = " -e "PostDown = " -e "Table = " /etc/wireguard/wg0.conf | wg syncconf wg0 /dev/stdin'
/etc/systemd/system/wgui.service :
[Unit] Description=Restart WireGuard After=network.target [Service] Type=oneshot # User=root # Group=root # ExecStart=/usr/bin/systemctl restart wg-quick@wg0.service ExecStart=/bin/sh -c 'grep -v -e "^Address = " -e "MTU = " -e "PostUp = " -e "PreDown = " -e "PostDown = " -e "Table = " /etc/wireguard/wg0.conf | wg syncconf wg0 /dev/stdin' [Install] RequiredBy=wgui.path
I propose replacing the systemctl restart wg-quick@wg0.service command with wg syncconf wg0 in the service execution command. This change aims to prevent network disruptions during the reconfiguration process. Here's the suggested modification: Replace:
ExecStart=/usr/bin/systemctl restart wg-quick@wg0.service
With:ExecStart=/bin/sh -c 'grep -v -e "^Address = " -e "MTU = " -e "PostUp = " -e "PreDown = " -e "PostDown = " -e "Table = " /etc/wireguard/wg0.conf | wg syncconf wg0 /dev/stdin'
/etc/systemd/system/wgui.service :