summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-scripts')
-rwxr-xr-xnet-scripts/init.d/net.lo2
-rw-r--r--net-scripts/net.modules.d/iwconfig29
2 files changed, 29 insertions, 2 deletions
diff --git a/net-scripts/init.d/net.lo b/net-scripts/init.d/net.lo
index 0ee6262..f73dfac 100755
--- a/net-scripts/init.d/net.lo
+++ b/net-scripts/init.d/net.lo
@@ -796,6 +796,7 @@ run_start() {
# We need to mark the service as started incase a
# postdown function wants to restart services that depend on us
mark_service_started "net.${iface}"
+ end_service "net.${iface}" 0
einfo "Running postup function"
eindent
( postup "${iface}" )
@@ -840,6 +841,7 @@ run_stop() {
# We need to mark the service as stopped incase a
# postdown function wants to restart services that depend on us
[[ ${IN_BACKGROUND} != "true" ]] && mark_service_stopped "net.${iface}"
+ end_service "net.${iface}" 0
einfo "Running postdown function"
eindent
( postdown "${iface}" )
diff --git a/net-scripts/net.modules.d/iwconfig b/net-scripts/net.modules.d/iwconfig
index 73fa5b0..0711043 100644
--- a/net-scripts/net.modules.d/iwconfig
+++ b/net-scripts/net.modules.d/iwconfig
@@ -170,7 +170,7 @@ iwconfig_user_config() {
if [[ -n ${!conf} ]]; then
aconf=( "${!conf}" )
for conf in "${aconf[@]}" ; do
- if ! eval iwconfig "${iface}" "${conf}" ; then
+ if ! iwconfig "${iface}" ${conf} ; then
ewarn "${iface} does not support the following configuration commands"
ewarn " ${conf}"
fi
@@ -181,7 +181,7 @@ iwconfig_user_config() {
if [[ -n ${!conf} ]]; then
aconf=( "${!conf}" )
for conf in "${aconf[@]}" ; do
- if ! eval iwpriv "${iface}" "${conf}" ; then
+ if ! iwpriv "${iface}" ${conf} ; then
ewarn "${iface} does not support the following private ioctls"
ewarn " ${conf}"
fi
@@ -512,6 +512,31 @@ iwconfig_scan() {
x="$( echo "${!x:-managed}" | tr '[:upper:]' '[:lower:]' )"
[[ ${mode} != "${x}" ]] && iwconfig "${iface}" mode "${x}"
+ # Strip any duplicates
+ local i j x="${#mac[@]}" y
+ for (( i=0; i<x-1; i++ )) ; do
+ [[ -z ${mac[i]} ]] && continue
+ for (( j=i+1; j<x; j++)) ; do
+ if [[ ${mac[i]} == "${mac[j]}" ]] ; then
+ if [[ ${qual[i]} -gt ${qual[j]} ]] ; then
+ y="${j}"
+ else
+ y="${j}"
+ fi
+ unset mac[y]
+ unset qual[y]
+ unset essid[y]
+ unset mode[y]
+ unset enc[y]
+ fi
+ done
+ done
+ mac=( "${mac[@]}" )
+ qual=( "${qual[@]}" )
+ essid=( "${essid[@]}" )
+ mode=( "${mode[@]}" )
+ enc=( "${enc[@]}" )
+
for (( i=0; i<${#mac[@]}; i++ )); do
# Don't like ad-hoc nodes by default
[[ ${mode[i]} == "ad-hoc" ]] && (( qual[i]-=10000 ))