1 |
#!/bin/bash |
#!/bin/bash |
2 |
# $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/network,v 1.5 2005-09-20 20:22:05 niro Exp $ |
# $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/network,v 1.6 2005-09-22 22:15:38 niro Exp $ |
3 |
|
|
4 |
#%rlevels: 0:k 1:k 2:k 3:s 4:s 5:s 6:k |
#%rlevels: 0:k 1:k 2:k 3:s 4:s 5:s 6:k |
5 |
#%start: 20 |
#%start: 20 |
133 |
|
|
134 |
networking_start() |
networking_start() |
135 |
{ |
{ |
136 |
local iface |
local iface dns |
137 |
|
|
138 |
# get list of all devices |
# get list of all devices |
139 |
for iface in $(onboot_interface_list ${network_settings}/net.*) |
for iface in $(onboot_interface_list ${network_settings}/net.*) |
167 |
# setup def gw |
# setup def gw |
168 |
if [[ -n ${GATEWAY} ]] |
if [[ -n ${GATEWAY} ]] |
169 |
then |
then |
170 |
echo -e ${COLOREDSTAR}"Setting up default gateway ..." |
echo -e ${COLOREDSTAR}"Setting up default gateway for ${COLBLUE}${iface}${COLDEFAULT} ..." |
171 |
route add default gateway ${GATEWAY} metric 1 dev ${iface} |
route add default gateway ${GATEWAY} metric 1 dev ${iface} |
172 |
evaluate_retval |
evaluate_retval |
173 |
fi |
fi |
174 |
|
|
175 |
|
# setup /etc/resolv.conf |
176 |
|
if [[ -n ${NAMESERVER} ]] |
177 |
|
then |
178 |
|
echo -e ${COLOREDSTAR}"Setting up all nameserver for ${COLBLUE}${iface}${COLDEFAULT} ..." |
179 |
|
|
180 |
|
# whipe out the old one |
181 |
|
echo "# Generated by the magellan-initscripts for ${iface}" > /etc/resolv.conf |
182 |
|
for dns in ${NAMESERVER} |
183 |
|
do |
184 |
|
echo "nameserver ${dns}" >> /etc/resolv.conf |
185 |
|
done |
186 |
|
fi |
187 |
|
|
188 |
# setup wlan extensions |
# setup wlan extensions |
189 |
if [ -x /usr/sbin/iwconfig ] |
if [ -x /usr/sbin/iwconfig ] |
190 |
then |
then |