mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-04-21 20:12:33 +03:00
added instructions for openrc inotifyd config watching on alpine to README.md
This commit is contained in:
parent
cd7f6e500a
commit
05e7cfafb1
1 changed files with 29 additions and 0 deletions
29
README.md
29
README.md
|
@ -33,6 +33,8 @@ Download the binary file from the release and run it with command:
|
|||
## Auto restart WireGuard daemon
|
||||
WireGuard-UI only takes care of configuration generation. You can use systemd to watch for the changes and restart the service. Following is an example:
|
||||
|
||||
### systemd
|
||||
|
||||
Create /etc/systemd/system/wgui.service
|
||||
|
||||
```
|
||||
|
@ -59,11 +61,38 @@ WantedBy=multi-user.target
|
|||
```
|
||||
|
||||
Apply it
|
||||
|
||||
```
|
||||
systemctl enable wgui.{path,service}
|
||||
systemctl start wgui.{path,service}
|
||||
```
|
||||
|
||||
### openrc
|
||||
|
||||
Create and `chmod +x` /usr/local/bin/wgui
|
||||
```
|
||||
#!/bin/sh
|
||||
wg-quick down wg0
|
||||
wg-quick up wg0
|
||||
```
|
||||
|
||||
Create and `chmod +x` /etc/init.d/wgui
|
||||
```
|
||||
#!/sbin/openrc-run
|
||||
|
||||
command=/sbin/inotifyd
|
||||
command_args="/usr/local/bin/wgui /etc/wireguard/wg0.conf:w"
|
||||
pidfile=/run/${RC_SVCNAME}.pid
|
||||
command_background=yes
|
||||
```
|
||||
|
||||
Apply it
|
||||
|
||||
```
|
||||
rc-service wgui start
|
||||
rc-update add wgui default
|
||||
```
|
||||
|
||||
## Build
|
||||
|
||||
### Build docker image
|
||||
|
|
Loading…
Add table
Reference in a new issue