2018-05-17 15:16:49 +02:00
|
|
|
[Unit]
|
|
|
|
Description=Call wg-quick
|
|
|
|
PartOf=wireguard.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
2018-05-17 16:31:06 +02:00
|
|
|
{%- for endpoint in endpoints %}
|
2019-04-01 10:22:50 +02:00
|
|
|
ExecStart=-/bin/ip route add {{ endpoint.split(':')[0] }}/32 via {{ gateway }}
|
2018-05-17 16:31:06 +02:00
|
|
|
{%- endfor %}
|
2018-05-17 15:44:36 +02:00
|
|
|
ExecStart=/usr/bin/wg-quick up /etc/wireguard/%i.conf
|
|
|
|
ExecStop=/usr/bin/wg-quick down /etc/wireguard/%i.conf
|
2018-05-17 16:08:01 +02:00
|
|
|
RemainAfterExit=true
|
2018-05-17 15:16:49 +02:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|