diff --git a/templates/wol-interfaces.service.j2 b/templates/wol-interfaces.service.j2 index 2523e23..9e893ee 100644 --- a/templates/wol-interfaces.service.j2 +++ b/templates/wol-interfaces.service.j2 @@ -5,8 +5,13 @@ Wants=network.target [Service] Type=oneshot -ExecStart=/bin/bash -c '{% 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 %}/sbin/ethtool -s {{ intf }} wol {{ wol_mode }}; {% endif %}{% endfor %}' +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 ":" }}' RemainAfterExit=yes [Install]