#!/bin/ash
#
#
 INTERFACE=eth0
 if [ -e /etc/interface ]; then
   INTERFACE=$(cat /etc/interface)
 fi
 LIST=$(ls /sys/class/net | grep -v lo)
 for i in $LIST; do
   echo -n $(ifconfig $i | grep Mask) > /tmp/g-i.tmp
   if [ -s /tmp/g-i.tmp ]; then
     INTERFACE=$i
   fi
 done
 rm /tmp/g-i.tmp