File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ These environment variables only apply to the docker container.
105105| -----------------------| ---------------------------------------------------------------| ---------|
106106| ` WGUI_MANAGE_START ` | Start/stop WireGuard when the container is started/stopped | ` false ` |
107107| ` WGUI_MANAGE_RESTART ` | Auto restart WireGuard when we Apply Config changes in the UI | ` false ` |
108+ | ` WGUI_MANAGE_RELOAD ` | Auto reload WireGuard when we Apply Config changes in the UI | ` false ` |
108109
109110## Auto restart WireGuard daemon
110111
@@ -198,6 +199,10 @@ running the container with `restart: unless-stopped`. These settings can also pi
198199Path, after restarting the container. Please make sure you have ` --cap-add=NET_ADMIN ` in your container config to make
199200this feature work.
200201
202+ Set ` WGUI_MANAGE_RELOAD=true ` to manage Wireguard interface reload.
203+ Using ` WGUI_MANAGE_RELOAD=true ` will use ` wg syncconf wg0 /path/to/file ` to update the wireguard running-configuration
204+ without restart. Please make sure you have ` --cap-add=NET_ADMIN ` in your container config to make this feature work.
205+
201206## Build
202207
203208### Build docker image
Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ case $WGUI_MANAGE_RESTART in (1|t|T|true|True|TRUE)
1818 done &
1919esac
2020
21+ # manage wireguard reload
22+ case $WGUI_MANAGE_RELOAD in (1|t|T|true|True|TRUE)
23+ [[ -f $conf ]] || touch " $conf " # inotifyd needs file to exist
24+ inotifyd - " $conf " :w | while read -r event file; do
25+ wg syncconf wg0 <( wg-quick strip wg0)
26+ done &
27+ esac
2128
2229./wg-ui &
2330wait $!
You can’t perform that action at this time.
0 commit comments