#!/bin/sh
IPADDR="192.168.50.1"

DEVNAME="$1"
COMMAND="$2"

case $COMMAND in
    'start')
        # static 
        #ifconfig $DEVNAME $IPADDR up
        
        # dhcp
        ifconfig $DEVNAME up
        dhcpcd $DEVNAME
    ;;
    
    'stop')
        # static 
        #ifconfig $DEVNAME down
        
        # dhcp
        dhcpcd -k -d $DEVNAME
        ifconfig $DEVNAME down
    ;;
    
    *)
        exit 1
    ;;

esac
exit 0

# EOF #
