2 ################################################################################
4 # File: make_resolv_conf
5 # Description: A script to create a valid /etc/resolv.conf
6 # Author: Andrew DeFaria, California Language Labs
7 # Created: Wed Jan 15 16:52:22 PST 1997
8 # Modified: Wed Jan 15 16:52:22 PST 1997 (Andrew DeFaria) defaria@cup.hp.com
11 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
13 ################################################################################
17 print -u2 "$me: [ <primary dns> ] [ <secondary dns> ]"
22 primary_dns="15.28.98.95 # smildon"
23 secondary_dns="15.0.96.86 # masher"
24 trierary_dns="15.13.168.80 # hparch4"
29 elif [ $# -eq 1 ]; then
33 resolv_conf_file=/etc/resolv.conf
35 # Don't copy this time...
36 #cp $resolv_conf_file $resolv_conf_file.old
38 print "domain cup.hp.com" > $resolv_conf_file
39 print "search cup.hp.com hp.com ch.apollo.hp.com" >> $resolv_conf_file
40 print "nameserver $primary_dns" >> $resolv_conf_file
41 print "nameserver $secondary_dns" >> $resolv_conf_file
42 print "nameserver $trierary_dns" >> $resolv_conf_file
44 # If machine runs cupmail (see root crontab) then we need to make a .local
46 cp $resolv_conf_file $resolv_conf_file.local
48 print "$me: Created new $resolv_conf_file"
49 #print "$me: Saved old $resolv_conf_file in $resolv_conf_file.old"