This commit is contained in:
Roy Marples 2009-04-19 21:02:31 +00:00
parent a01f9be6f2
commit 8e5a601087

View File

@ -39,7 +39,7 @@ reverse()
sys_interfaces() sys_interfaces()
{ {
case "${RC_UNAME}" in case "$RC_UNAME" in
Linux) Linux)
local w= rest= i= cmd=$1 local w= rest= i= cmd=$1
while read w rest; do while read w rest; do
@ -61,7 +61,7 @@ auto_interfaces()
{ {
local ifs= c= f= local ifs= c= f=
case "${RC_UNAME}" in case "$RC_UNAME" in
NetBSD) NetBSD)
for c in $(ifconfig -C 2>/dev/null); do for c in $(ifconfig -C 2>/dev/null); do
for f in /etc/ifconfig.${c}[0-9]*; do for f in /etc/ifconfig.${c}[0-9]*; do
@ -111,7 +111,7 @@ runip()
err=$(LC_ALL=C ip address add "$@" dev "$int" 2>&1) err=$(LC_ALL=C ip address add "$@" dev "$int" 2>&1)
[ -z "$err" ] && return 0 [ -z "$err" ] && return 0
if [ "$err" = "RTNETLINK answers: File exists" ]; then if [ "$err" = "RTNETLINK answers: File exists" ]; then
ip address del "$@" dev "${int}" 2>/dev/null ip address del "$@" dev "$int" 2>/dev/null
fi fi
# Localise the error # Localise the error
ip address add "$@" dev "$int" ip address add "$@" dev "$int"
@ -119,7 +119,7 @@ runip()
routeflush() routeflush()
{ {
if [ "${RC_UNAME}" = Linux ]; then if [ "$RC_UNAME" = Linux ]; then
if [ -x /sbin/ip ]; then if [ -x /sbin/ip ]; then
ip route flush scope global ip route flush scope global
else else
@ -167,7 +167,7 @@ start()
local cr=0 r= int= cmd= args= upcmd= local cr=0 r= int= cmd= args= upcmd=
einfo "Starting network" einfo "Starting network"
routeflush routeflush
if [ "${RC_UNAME}" = "Linux" ]; then if [ "$RC_UNAME" = "Linux" ]; then
ifconfig lo 127.0.0.1 netmask 255.0.0.0 || cr=1 ifconfig lo 127.0.0.1 netmask 255.0.0.0 || cr=1
route add -net 127.0.0.0 netmask 255.0.0.0 \ route add -net 127.0.0.0 netmask 255.0.0.0 \
gw 127.0.0.1 2>/dev/null gw 127.0.0.1 2>/dev/null
@ -225,7 +225,7 @@ start()
if [ -n "$defaultroute" ]; then if [ -n "$defaultroute" ]; then
ebegin "Setting default route $defaultroute" ebegin "Setting default route $defaultroute"
if [ "${RC_UNAME}" = Linux ]; then if [ "$RC_UNAME" = Linux ]; then
route add default gw $defaultroute route add default gw $defaultroute
else else
route add default $defaultroute route add default $defaultroute