Changeset View
Changeset View
Standalone View
Standalone View
etc/network.subr
Show First 20 Lines • Show All 1,243 Lines • ▼ Show 20 Lines | ifscript_down() | ||||
if [ -r /etc/stop_if.$1 ]; then | if [ -r /etc/stop_if.$1 ]; then | ||||
. /etc/stop_if.$1 | . /etc/stop_if.$1 | ||||
return 0 | return 0 | ||||
else | else | ||||
return 1 | return 1 | ||||
fi | fi | ||||
} | } | ||||
# wlan_up | |||||
# Create IEEE802.3 interfaces. | |||||
# | |||||
wlan_up() | |||||
{ | |||||
local _list _iflist wlan parent ifn | |||||
_list= | |||||
_iflist=$* | |||||
for wlan in `set | egrep ^wlans_[a-z]+[0-9]+=[a-z]+[0-9]+`; do | |||||
# Parse wlans_$parent=$ifn | |||||
wlan=`echo $wlan | sed -E 's/wlans_([a-z]+[0-9]+)=([a-z]+[0-9]+)/\1:\2/'` | |||||
OIFS=$IFS; IFS=:; set -- $wlan; parent=$1; ifn=$2; IFS=$OIFS | |||||
case $_iflist in | |||||
""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; | |||||
*) continue ;; | |||||
esac | |||||
# Skip if ${ifn} already exists. | |||||
if ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then | |||||
continue | |||||
fi | |||||
${IFCONFIG_CMD} ${ifn} create wlandev ${parent} | |||||
if [ $? -eq 0 ]; then | |||||
_list="$_list $ifn" | |||||
fi | |||||
done | |||||
if [ -n "${_list# }" ]; then | |||||
echo "Created wlan interfaces: ${_list# }." | |||||
fi | |||||
debug "Wlans: ${_list# }" | |||||
} | |||||
# clone_up | # clone_up | ||||
# Create cloneable interfaces. | # Create cloneable interfaces. | ||||
# | # | ||||
clone_up() | clone_up() | ||||
{ | { | ||||
local _list ifn ifopt _iflist _n tmpargs | local _list ifn ifopt _iflist _n tmpargs | ||||
_list= | _list= | ||||
_iflist=$* | _iflist=$* | ||||
▲ Show 20 Lines • Show All 460 Lines • Show Last 20 Lines |