net-netmask revision 6ba597c56d749c61b4f783157f63196d7b2445f0
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# CDDL HEADER START
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater# The contents of this file are subject to the terms of the
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# Common Development and Distribution License (the "License").
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# You may not use this file except in compliance with the License.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# See the License for the specific language governing permissions
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# and limitations under the License.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# If applicable, add the following below this CDDL HEADER, with the
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# fields enclosed by brackets "[]" replaced with your own identifying
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# information: Portions Copyright [yyyy] [name of copyright owner]
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# CDDL HEADER END
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
e939674d53a127ddeeaf4b41fd72933f0b493308Mark Andrews# Use is subject to license terms.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# Reset netmask and broadcast address whenever new information is
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# availabe from NIS.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# In a shared-IP zone we need this service to be up, but all of the
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# work it tries to do is irrelevant (and will actually lead to the
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# service failing if we try to do it), so just bail out.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# In the global zone and exclusive-IP zones we proceed.
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark Andrews# Wait up to 5 seconds for ypbind to obtain a binding.
207cee019eb5cbbe7c905f7c52f7b5d11f8c0305Automatic Updater for i in 1 2 3 4 5; do
6ea2385360e9e2167e65f9286447da9eea189457Tinderbox User [ $? -eq 0 -a -n "$server" ] && return 0 || sleep 1
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Reset the netmask and broadcast address for our network interfaces.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Since this may result in a name service lookup, we want to now wait
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# for NIS to come up if we previously started it.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein[ -z "$domain" ] || [ ! -d /var/yp/binding/$domain ] || wait_nis || \
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington echo "WARNING: Timed out waiting for NIS to come up" >& 2
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Re-set the netmask and broadcast addr for all IP interfaces. This
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# ifconfig is run here, after waiting for name services, so that
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# "netmask +" will find the netmask if it lives in a NIS map. The 'D'
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# in -auD tells ifconfig NOT to mess with the interface if it is
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# under DHCP control
e939674d53a127ddeeaf4b41fd72933f0b493308Mark Andrews# Uncomment these lines to print complete network interface configuration
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# echo "network interface configuration:"