#! /bin/sh
### ABEM script to set network into differen modes

case "$1" in
    init)
        ;;
    dhcpserver)
        #become dhcp server
	/etc/init.d/openvpn stop
	/etc/init.d/ifplugd stop
        ifconfig eth0 192.168.23.1
        udhcpd
        ;;

    dynamic)
        #become a network device
	killall udhcpd
	ifconfig eth0 0.0.0.0
	/etc/init.d/ifplugd start
	/etc/init.d/openvpn start
        ;;
    wifiap)
        ;;
    wificlient)
        ;;
    *)
        echo "Usage: $N {dhcpserver|dynamic| wifiap | wificlient}" >&2
        exit 1
        ;;
esac

exit 0
