# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2010-2011 Roman Weber (roman@openelec.tv)
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)

ACTION!="add|change", GOTO="end"
SUBSYSTEM!="net", GOTO="end"
ENV{INTERFACE}!="eth*", GOTO="end"

TEST=="/sys/class/net/$env{INTERFACE}/device/power/wakeup", RUN+="/bin/sh -c 'echo enabled >/sys/class/net/$env{INTERFACE}/device/power/wakeup'"
RUN+="/usr/sbin/ethtool -s $env{INTERFACE} wol g"

LABEL="end"
