#!/bin/sh

### BEGIN INIT INFO
# Provides:          wol
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start wol at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

IF=$(ip link | awk -F: '$0 !~ "lo|vir|wl|^[^0-9]"{print $2;getline}')
/sbin/ethtool -s $IF wol g
echo "WOL enabled for interface: $IF"
