Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/shcd /etc/sysconfig/network-scripts. ./network-functions[ -f ../network ] && . ../networkunset REALDEVICEif [ "$1" = --realdevice ] ; thenREALDEVICE=$2shift 2fiCONFIG=$1source_config[ -z "$REALDEVICE" ] && REALDEVICE=$DEVICEif [ "$ISALIAS" = no ] ; then/etc/sysconfig/network-scripts/ifup-aliases ${DEVICE} ${CONFIG}fi/etc/sysconfig/network-scripts/ifup-routes ${REALDEVICE} ${DEVNAME}if [ "$PEERDNS" != "no" ] ||[ -n "$RESOLV_MODS" -a "$RESOLV_MODS" != "no" ]; then[ -n "$MS_DNS1" ] && DNS1=$MS_DNS1[ -n "$MS_DNS2" ] && DNS2=$MS_DNS2if [ -n "$DNS1" ] && ! grep -q "^nameserver $DNS1" /etc/resolv.conf &&tr=$(mktemp /tmp/XXXXXX) ; thencurrent_replacement="$DNS1"next_replacement="$DNS2"search=(cat /etc/resolv.conf ; echo EOF ; echo EOF) | while read answer ; docase $answer innameserver*|EOF)if [ -n "$current_replacement" ] ; thenecho "nameserver $current_replacement" >> $trif [ -n "$next_replacement" ] ; thencurrent_replacement="$next_replacement"next_replacement=elsecurrent_replacement=fielseif [ "$answer" != EOF ] ; thenecho "$answer" >> $trfifi;;domain*|search*)if [ -n "$DOMAIN" ]; thenecho "$answer" | while read key value ; dosearch="$search $value"doneelseecho "$answer" >> $trfi;;*)echo "$answer" >> $tr;;esacdoneif [ -n "$DOMAIN" ]; thenecho "search $DOMAIN $search" >> $trfi# backup resolv.confcp -af /etc/resolv.conf /etc/resolv.conf.save# maintain permissions# but set umask in case it doesn't exist!oldumask=$(umask)umask 022change_resolv_conf $trrm -f $trumask $oldumaskfifi# don't set hostname on ppp/slip connectionsif [ "$2" = "boot" -a \"${DEVICE}" != lo -a \"${DEVICETYPE}" != "ppp" -a \"${DEVICETYPE}" != "slip" ]; thenif need_hostname; thenIPADDR=$(LANG=C ip -o -4 addr ls dev ${DEVICE} | awk '{ print $4 ; exit }')eval $(/bin/ipcalc --silent --hostname ${IPADDR} ; echo "status=$?")if [ "$status" = "0" ]; thenset_hostname $HOSTNAMEfififi# Notify programs that have requested notificationdo_netreportif [ -x /sbin/ifup-local ]; then/sbin/ifup-local ${DEVICE}fiexit 0