#!/bin/sh /etc/rc.common
# Copyright (C) 2009 Ubicom, Inc.

if [ $action = "start" ]	
then
	echo "Starting network"
	# start localhost
	ifconfig lo up
	route add -net 127.0.0.0 netmask 255.0.0.0 lo

	# portmap is requred for nfs
	portmap & 
	# inetd server
	inetd &

	# Setup the VLAN interfaces and Eth0
	ifconfig eth0 up

	# Add the virtual interfaces
	vconfig add eth0 1
	vconfig add eth0 2

	# Create a bridge and add LAN interface to it.
	ifconfig eth0.2 up

	/etc/init.d/create_gpio

	sleep 2	
elif [ $action = "stop"	]
then
	echo "Stopping network"
	ifconfig lo down 
fi

