#!/bin/sh
# Set the router for this interface
echo $1 > /tmp/$2_router
# Remove file if it exists
if [ -f /var/etc/nameserver_$2 ]; then
rm -f /var/etc/nameserver_$2
fi
# DNS1
if [ "$3" != "DNS0" ]; then
echo $3 >> /var/etc/nameserver_$2
fi
# DNS2
if [ "$4" != "DNS1" ]; then
echo $4 >> /var/etc/nameserver_$2
fi