diff options
Diffstat (limited to 'contrib/examples/systemd/wgserver.service')
-rw-r--r-- | contrib/examples/systemd/wgserver.service | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/contrib/examples/systemd/wgserver.service b/contrib/examples/systemd/wgserver.service new file mode 100644 index 0000000..dfce1e9 --- /dev/null +++ b/contrib/examples/systemd/wgserver.service @@ -0,0 +1,15 @@ +[Unit] +Description=WireGuard Server + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/ip link add dev wgserver type wireguard +ExecStart=/bin/ip address add 192.168.177.1/24 dev wgserver +ExecStart=/usr/bin/wg setconf wgserver /etc/wireguard-server.conf +ExecStart=/bin/ip link set up dev wgserver +ExecStop=/bin/sh -c 'umask 077; /usr/bin/wg showconf wgserver > /etc/wireguard-server.conf.tmp && mv /etc/wireguard-server.conf.tmp /etc/wireguard-server.conf' +ExecStop=/bin/ip link del dev wgserver + +[Install] +WantedBy=multi-user.target |