#! /bin/sh

IFCMD="$DEVICE $ADDRESS"
if [ "$NETMASK" ]; then
    IFCMD="$IFCMD netmask $NETMASK"
fi
/sbin/ifconfig $IFCMD || exit 1
/sbin/route add $ADDRESS || exit 1
if [ "$GATEWAY" ]; then
    /sbin/route add default gw $GATEWAY || exit 1
fi
if [ "$DNS" ]; then
    echo "nameserver $DNS" > /etc/resolv.conf
fi
exit 0
