add systemd services
This commit is contained in:
parent
d8c78d3965
commit
ef0b0c489c
12
systemd/vpnclient-wg-restart.service
Normal file
12
systemd/vpnclient-wg-restart.service
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Wireguard Restart
|
||||||
|
After=network-online.target vpnclient-mount.service
|
||||||
|
Requires=network-online.target
|
||||||
|
Requisite=vpnclient-mount.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/snacks/wireguard/scripts/rotate.py
|
||||||
|
NetworkNamespacePath=/run/vpn/net
|
12
systemd/vpnclient-wg-restart.timer
Normal file
12
systemd/vpnclient-wg-restart.timer
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Reconnect to WireGuard if down
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=5m
|
||||||
|
OnUnitActiveSec=1m
|
||||||
|
Persistent=False
|
||||||
|
Unit=vpnclient-wg-restart.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
|
|
17
systemd/vpnclient-wg.service
Normal file
17
systemd/vpnclient-wg.service
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Wireguard
|
||||||
|
After=network-online.target vpnclient-mount.service
|
||||||
|
Requires=network-online.target
|
||||||
|
Requisite=vpnclient-mount.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
Type=oneshot
|
||||||
|
EnvironmentFile=/snacks/wireguard/env
|
||||||
|
ExecStart=/snacks/wireguard/scripts/connect.py
|
||||||
|
NetworkNamespacePath=/run/vpn/net
|
||||||
|
RemainAfterExit=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user