add Wireguard systemd service configuration
This commit is contained in:
parent
fea4d78d1e
commit
262381c930
8
Makefile
Normal file
8
Makefile
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
all: wg
|
||||||
|
|
||||||
|
wg: /etc/systemd/system/wg-gen.service /etc/systemd/system/wg-gen.path
|
||||||
|
systemctl enable wg-gen.{path,service}
|
||||||
|
systemctl start wg-gen.{path,service}
|
||||||
|
|
||||||
|
/etc/systemd/system/wg-gen.%: wg/wg-gen.%
|
||||||
|
cp $< $@
|
8
wg/wg-gen.path
Normal file
8
wg/wg-gen.path
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Watch /etc/wireguard for changes
|
||||||
|
|
||||||
|
[Path]
|
||||||
|
PathModified=/etc/wireguard
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
10
wg/wg-gen.service
Normal file
10
wg/wg-gen.service
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Restart WireGuard
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/bin/systemctl restart wg-quick@wg0.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Reference in a new issue