#!/bin/sh # if [ "$1" = "prereqs" ]; then exit 0 fi quiet=n . /conf/tcos.conf . /scripts/functions . /conf/tcos-run-functions if [ -z "$TCOS_WAKEONLAN" ]; then exit 0 fi # get list of network interfaces TCOS_NET_DEVS=$(ls /sys/class/net/|grep -v -e lo -e sit0 -e wmaster -e vmnet -e pan) # search for network interfaces with link ok status for dev in $TCOS_NET_DEVS; do # have link ??? if [ -e /sys/class/net/$dev/carrier ] && \ [ "$(cat /sys/class/net/$dev/carrier 2>/dev/null)" = 1 ] && \ [ "$(/usr/sbin/ethtool $dev| grep -c "Wake-on: g")" = "1" ] ; then _log "70WAKEONLAN Enabling WOL in $dev iface..." [ -x /usr/sbin/ethtool ] && \ /usr/sbin/ethtool -s $dev wol g >> /tmp/initramfs.debug 2>&1 fi done exit 0