diff --git a/packages/network/ethtool/install b/packages/network/ethtool/install index 6c0133eb2e..eb1399217f 100755 --- a/packages/network/ethtool/install +++ b/packages/network/ethtool/install @@ -4,3 +4,6 @@ mkdir -p $INSTALL/usr/sbin cp $PKG_BUILD/ethtool $INSTALL/usr/sbin + +mkdir -p $INSTALL/lib/udev/rules.d + cp $PKG_DIR/udev.d/*.rules $INSTALL/lib/udev/rules.d \ No newline at end of file diff --git a/packages/network/ethtool/init.d/14_ethtool b/packages/network/ethtool/udev.d/99-wakeup-eth.rules old mode 100755 new mode 100644 similarity index 79% rename from packages/network/ethtool/init.d/14_ethtool rename to packages/network/ethtool/udev.d/99-wakeup-eth.rules index 16a797d44b..c235ad8353 --- a/packages/network/ethtool/init.d/14_ethtool +++ b/packages/network/ethtool/udev.d/99-wakeup-eth.rules @@ -1,5 +1,3 @@ -#!/bin/sh - ################################################################################ # Copyright (C) 2009-2010 OpenELEC.tv # http://www.openelec.tv @@ -20,12 +18,11 @@ # http://www.gnu.org/copyleft/gpl.html ################################################################################ -# enable WOL on eth0 and eth1 -# -# runlevels: openelec, textmode +ACTION!="add|change", GOTO="end" +SUBSYSTEM!="net", GOTO="end" +ENV{INTERFACE}!="eth*", GOTO="end" -. /etc/profile +RUN+="/bin/sh -c 'echo enabled >/sys/class/net/$env{INTERFACE}/device/power/wakeup' " +RUN+="/usr/sbin/ethtool -s $env{INTERFACE} wol g" -progress "enable WOL on eth0 and (maybe) eth1" - /usr/sbin/ethtool -s eth0 wol g > /dev/null 2>&1 & - /usr/sbin/ethtool -s eth1 wol g > /dev/null 2>&1 & +LABEL="end" \ No newline at end of file