ACC SHELL

Path : /usr/lib/pm-utils/power.d/
File Upload :
Current File : //usr/lib/pm-utils/power.d/wol

#!/bin/bash
#
# Script to set the wake on lan state
#
# Copyright (C) 2009 Holger Macht <hmacht@suse.de>
# Copyright (C) 2010 Michal Vyskocil <mvyskocil@suse.cz> - HAL removal
#
# This file is released under the GPLv2.
#

. /usr/lib/pm-utils/functions

[ -z "$WOL" ] && exit $NA

function set_wol() {
for IFACE in `ls -1 /sys/class/net/`; do
    if ! /sbin/ethtool $IFACE | grep -q 'Supports Wake-on:'; then
        continue
    fi
    /sbin/ethtool -s $IFACE wol $1
done
}

case "$1" in
	true)
		echo "**wol -> disable"
		set_wol d
		;;
	false)
		echo "**wol -> enable, set flags $WOL"
		set_wol $WOL
		;;
esac

ACC SHELL 2018