summaryrefslogtreecommitdiff
path: root/roles/network/wakeonlan/templates
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-01-23 23:18:18 +0100
committerChristian Pointner <equinox@spreadspace.org>2021-01-23 23:18:18 +0100
commit5894254e71c909850e96c872b61ca6a9db85e0ac (patch)
treea1f1b1cf7fa33e7ce8d4c92c80c3c48e85b1d909 /roles/network/wakeonlan/templates
parentmove wireguard to network sub-dir (diff)
add wakeonlan role
Diffstat (limited to 'roles/network/wakeonlan/templates')
-rw-r--r--roles/network/wakeonlan/templates/wakeonlan.service.j225
1 files changed, 25 insertions, 0 deletions
diff --git a/roles/network/wakeonlan/templates/wakeonlan.service.j2 b/roles/network/wakeonlan/templates/wakeonlan.service.j2
new file mode 100644
index 00000000..c163e8a7
--- /dev/null
+++ b/roles/network/wakeonlan/templates/wakeonlan.service.j2
@@ -0,0 +1,25 @@
+[Unit]
+Description=Configure Wake-on-LAN
+
+[Service]
+Type=oneshot
+{% for interface in wakeonlan_interfaces %}
+ExecStart=/usr/sbin/ethtool -s {{ interface }} wol {{ wakeonlan_options | join }}
+{% endfor %}
+{% for interface in wakeonlan_interfaces %}
+ExecStop=/usr/sbin/ethtool -s {{ interface }} wol d
+{% endfor %}
+RemainAfterExit=yes
+NoNewPrivileges=yes
+PrivateTmp=yes
+PrivateDevices=yes
+ProtectSystem=strict
+ProtectHome=yes
+ProtectKernelTunables=yes
+ProtectControlGroups=yes
+RestrictRealtime=yes
+RestrictAddressFamilies=AF_UNIX AF_NETLINK
+SystemCallArchitectures=native
+
+[Install]
+WantedBy=basic.target