diff options
3 files changed, 16 insertions, 0 deletions
diff --git a/core/modules/etherwake/data/etc/cron.d/enable-wol b/core/modules/etherwake/data/etc/cron.d/enable-wol new file mode 100644 index 00000000..bd2fd2d2 --- /dev/null +++ b/core/modules/etherwake/data/etc/cron.d/enable-wol @@ -0,0 +1,5 @@ +SHELL=/bin/ash +PATH=/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin + +11 * * * * root /opt/openslx/scripts/cron-enable_wol +@reboot root /opt/openslx/scripts/cron-enable_wol diff --git a/core/modules/etherwake/data/opt/openslx/scripts/cron-enable_wol b/core/modules/etherwake/data/opt/openslx/scripts/cron-enable_wol new file mode 100755 index 00000000..ffa7fbb9 --- /dev/null +++ b/core/modules/etherwake/data/opt/openslx/scripts/cron-enable_wol @@ -0,0 +1,8 @@ +#!/bin/ash + +for i in eth0 boot0; do + [ -e "/sys/class/net/$i" ] || continue + ethtool -s "$i" wol g +done + +exit 0 diff --git a/core/modules/idleaction/data/opt/openslx/scripts/systemd-idleaction_init b/core/modules/idleaction/data/opt/openslx/scripts/systemd-idleaction_init index 7c3afa00..13ac691c 100755 --- a/core/modules/idleaction/data/opt/openslx/scripts/systemd-idleaction_init +++ b/core/modules/idleaction/data/opt/openslx/scripts/systemd-idleaction_init @@ -59,6 +59,9 @@ if [ -n "$TEST" ]; then exit 0 fi +# Enable WOL again, in case it got disabled +/opt/openslx/scripts/cron-enable_wol + if [ -n "$NEXT" ]; then # Set -l and hope it does the right thing on DST rtcwake -l -m no -t "$NEXT" |