2025-12-26 10:41:25 +01:00
|
|
|
[Unit]
|
|
|
|
|
Description=Set Wake-on-LAN on network interfaces
|
|
|
|
|
After=network.target
|
|
|
|
|
Wants=network.target
|
|
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
Type=oneshot
|
2025-12-26 11:07:00 +01:00
|
|
|
ExecStart=/bin/bash -c '{% set cmds = [] %}
|
|
|
|
|
{% for intf, enabled, supported in en_interfaces | zip(wol_enabled.results, wol_supported.results) %}
|
|
|
|
|
{% if wol_mode in supported.stdout and wol_mode not in enabled.stdout %}
|
|
|
|
|
{% set _ = cmds.append("/sbin/ethtool -s " ~ intf ~ " wol " ~ wol_mode) %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
{{ cmds | join("; ") if cmds | length > 0 else ":" }}'
|
2025-12-26 10:41:25 +01:00
|
|
|
RemainAfterExit=yes
|
|
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
|
WantedBy=multi-user.target
|