A workaround would be to change the ```WG_INTERFACE_NAME``` to something different, as it will create a new interface (```wg-auto.conf``` for example), note that if you do so, you will have to adapt your daemon accordingly.
### Automatically apply changes using ```systemd```
Using `systemd.path` monitor for directory changes see [systemd doc](https://www.freedesktop.org/software/systemd/man/systemd.path.html)
```
# /etc/systemd/system/wg-gen-web.path
...
...
@@ -90,8 +87,8 @@ WantedBy=multi-user.target
```
Which will restart WireGuard service
### Example with ```inotifywait```
Using whatever init system create a daemon running this script
### Automatically apply changes using ```inotifywait```
For any other init system, create a daemon running this script
```
#!/bin/sh
while inotifywait -e modify -e create /etc/wireguard;do
...
...
@@ -102,9 +99,9 @@ done
## How to use with existing WireGuard configuration
After first run Wg Gen Web will create `server.json` in data directory with alla server informations.
After first run Wg Gen Web will create `server.json` in data directory with all server informations.
Fill free to modify this file in order to use your existing keys
Feel free to modify this file in order to use your existing keys