Lines 32-38
REALDEVICE=$1
Link Here
|
32 |
NS_IFUP=/etc/sysconfig/network-scripts/ifup-post |
32 |
NS_IFUP=/etc/sysconfig/network-scripts/ifup-post |
33 |
N_C_S_CONFIG=/etc/sysconfig/network |
33 |
N_C_S_CONFIG=/etc/sysconfig/network |
34 |
RESOLVCONF=/sbin/resolvconf |
34 |
RESOLVCONF=/sbin/resolvconf |
35 |
PPP_RESOLV_CONF=/etc/ppp/resolv.conf |
|
|
36 |
|
35 |
|
37 |
export PATH=/sbin:/usr/sbin:/bin:/usr/bin |
36 |
export PATH=/sbin:/usr/sbin:/bin:/usr/bin |
38 |
|
37 |
|
Lines 56-66
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
Link Here
|
56 |
. /etc/init.d/functions |
55 |
. /etc/init.d/functions |
57 |
SourceIfNotEmpty $N_C_S_CONFIG |
56 |
SourceIfNotEmpty $N_C_S_CONFIG |
58 |
|
57 |
|
|
|
58 |
[ -z "$MS_DNS1" ] || DNS1=$MS_DNS1 |
59 |
[ -z "$MS_DNS2" ] || DNS2=$MS_DNS2 |
60 |
|
59 |
# taken from net-scripts |
61 |
# taken from net-scripts |
60 |
modify_resolver() |
62 |
modify_resolv_conf() |
61 |
{ |
63 |
{ |
62 |
[ -z "$MS_DNS1" ] || DNS1=$MS_DNS1 |
|
|
63 |
[ -z "$MS_DNS2" ] || DNS2=$MS_DNS2 |
64 |
local tr |
64 |
local tr |
65 |
if [ -n "$DNS1" ] && ! grep -qs "^nameserver $DNS1" /etc/resolv.conf && |
65 |
if [ -n "$DNS1" ] && ! grep -qs "^nameserver $DNS1" /etc/resolv.conf && |
66 |
tr=`mktemp /etc/resolv.conf.XXXXXX`; then |
66 |
tr=`mktemp /etc/resolv.conf.XXXXXX`; then |
Lines 117-128
modify_resolver()
Link Here
|
117 |
fi |
117 |
fi |
118 |
} |
118 |
} |
119 |
|
119 |
|
|
|
120 |
update_via_resolvconf() |
121 |
{ |
122 |
local t |
123 |
t=$(mktemp -t resolv.conf.XXXXXXXXXX) || return |
124 |
local d |
125 |
for d in $DNS1 $DNS2; do |
126 |
echo "nameserver $d" >"$t" |
127 |
done |
128 |
if [ -s "$t" ]; then |
129 |
"$RESOLVCONF" -a "$REALDEVICE" <"$t" |
130 |
fi |
131 |
rm -f -- "$t" |
132 |
} |
133 |
|
120 |
if ! is_no "$RESOLV_MODS"; then |
134 |
if ! is_no "$RESOLV_MODS"; then |
121 |
if [ -x "$RESOLVCONF" ]; then |
135 |
if [ -x "$RESOLVCONF" ]; then |
122 |
[ -f "$PPP_RESOLV_CONF" ] && $RESOLVCONF -a $REALDEVICE <$PPP_RESOLV_CONF |
136 |
update_via_resolvconf |
123 |
else |
137 |
else |
124 |
# check if kppp was here, don't touch /etc/resolv.conf then, just UC |
138 |
# check if kppp was here, don't touch /etc/resolv.conf then, just UC |
125 |
grep -iqs '#.*ppp temp entry' /etc/resolv.conf || modify_resolver |
139 |
grep -iqs '#.*ppp temp entry' /etc/resolv.conf || modify_resolv_conf |
126 |
UC=/usr/sbin/update_chrooted |
140 |
UC=/usr/sbin/update_chrooted |
127 |
[ -x $UC ] && $UC conf |
141 |
[ -x $UC ] && $UC conf |
128 |
fi |
142 |
fi |
129 |
- |
|
|