#!/bin/sh if [ $# -eq 0 ]; then currentFile=$(basename "$0") echo "Usage: ./$currentFile " exit 0 fi # add users dns preference to the beginning of /etc/resolv.conf cp /etc/resolv.conf /tmp/resolv.conf.bak echo "nameserver $1" > /etc/resolv.conf cat /tmp/resolv.conf.bak >> /etc/resolv.conf