#! /bin/sh # # Startup script for USBnet (networking, instead of USB Mass Storage behaviour) # Author: Michael Mlivoncic PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=usbnet DESC="USB Networking for Nokia Internet Tablets" INITFILE=/etc/init.d/$NAME case "$1" in start) #umount /media/mmc1 #umount /media/mmc2 sleep 2 USBNET="`lsmod | grep g_ether`" KERNEL_VERSION="`uname -r`" if [ "$USBNET" = "" ] then echo "Entering Ethernet via USB mode (g_ether)..." insmod /mnt/initfs/lib/modules/$KERNEL_VERSION/g_ether.ko insmod /mnt/initfs/lib/modules/$KERNEL_VERSION/g_ether.ko echo "Waiting, then bringing up the usb0 interface.." sleep 1 /sbin/ifup usb0 else echo "Already in Ethernet-via-USB mode..." echo "Try ping 192.168.2.15" fi ;; stop) echo "switching back to USB Mass Storage mode..." echo "removing module g_ether" /sbin/ifdown usb0 sleep 2 rmmod g_ether ;; *) printf "Usage: $INITFILE {start|stop}\n" >&2 exit 1 ;; esac exit 0