Fix return values of ifconfig_up/down.

Reported by:	Andrea Campi
This commit is contained in:
Brooks Davis 2005-06-07 23:59:45 +00:00
parent 8f0ba923ab
commit cbac4adce6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147121

View File

@ -57,7 +57,7 @@ ifconfig_up()
_cfg=0 _cfg=0
fi fi
return ${cfg} return $_cfg
} }
# ifconfig_down if # ifconfig_down if
@ -69,7 +69,7 @@ ifconfig_down()
{ {
[ -z "$1" ] && return 1 [ -z "$1" ] && return 1
_ifs="^" _ifs="^"
_ret=1 _cfg=1
inetList="`ifconfig $1 | grep 'inet ' | tr "\n" "$_ifs"`" inetList="`ifconfig $1 | grep 'inet ' | tr "\n" "$_ifs"`"
@ -84,12 +84,13 @@ ifconfig_down()
IFS="$oldifs" IFS="$oldifs"
ifconfig $1 ${_inet} delete ifconfig $1 ${_inet} delete
IFS="$_ifs" IFS="$_ifs"
_ret=0 _cfg=0
done done
IFS="$oldifs" IFS="$oldifs"
if wpaif $1; then if wpaif $1; then
#/etc/rc.d/wpa_supplicant stop $1 #/etc/rc.d/wpa_supplicant stop $1
_cfg=0
fi fi
if dhcpif $1; then if dhcpif $1; then
@ -97,7 +98,7 @@ ifconfig_down()
_cfg=0 _cfg=0
fi fi
return $_ret return $_cfg
} }
# _ifconfig_getargs if # _ifconfig_getargs if