summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-scripts/net.modules.d/iwconfig')
-rw-r--r--net-scripts/net.modules.d/iwconfig34
1 files changed, 7 insertions, 27 deletions
diff --git a/net-scripts/net.modules.d/iwconfig b/net-scripts/net.modules.d/iwconfig
index 04055eb..7c389b3 100644
--- a/net-scripts/net.modules.d/iwconfig
+++ b/net-scripts/net.modules.d/iwconfig
@@ -27,6 +27,8 @@ iwpriv() {
iwconfig_depend() {
after plug
before interface
+ provide wireless
+ functions interface_up interface_down interface_exists
}
# bool iwconfig_check_installed(void)
@@ -48,28 +50,6 @@ iwconfig_check_installed() {
return 1
}
-# char* iwconfig_provides(void)
-#
-# Returns a string to change module definition for starting up
-iwconfig_provides() {
- echo "wireless"
-}
-
-# bool iwconfig_check_depends(void)
-#
-# Checks to see if we have the needed functions
-iwconfig_check_depends() {
- local f
-
- for f in interface_up interface_down interface_exists; do
- [[ $( type -t "${f}" ) == "function" ]] && continue
- eerror "iwconfig: missing required function ${f}\n"
- return 1
- done
-
- return 0
-}
-
# bool iwconfig_check_extensions(char *interface)
#
# Checks to see if wireless extensions are enabled on the interface
@@ -355,11 +335,11 @@ iwconfig_associate() {
else
ESSIDVAR=$( bash_variable "${ESSID}" )
key=$( iwconfig_get_wep_key "${mac}" )
- if [[ ${wep_required} == "yes" && ${key} == "off" ]]; then
+ if [[ ${wep_required} == "on" && ${key} == "off" ]]; then
vewarn "WEP key is not set for \"${dessid}\" - not connecting"
return 1
fi
- if [[ ${wep_required} == "no" && ${key} != "off" ]]; then
+ if [[ ${wep_required} == "off" && ${key} != "off" ]]; then
key="off"
vewarn "\"${dessid}\" is not WEP enabled - ignoring setting"
fi
@@ -383,7 +363,7 @@ iwconfig_associate() {
vebegin "Connecting to \"${dessid}\" ${w}"
- if [[ ${ESSID} != "any" && $( type -t preassociate ) == "function" ]]; then
+ if [[ ${ESSID} != "any" ]] && is_function preassociate ; then
veinfo "Running preassociate function"
eindent
( preassociate "${iface}" )
@@ -410,7 +390,7 @@ iwconfig_associate() {
iwconfig_user_config "${iface}"
iwconfig_report "${iface}"
- if [[ $( type -t postassociate ) == "function" ]]; then
+ if is_function postassociate ; then
veinfo "Running postassociate function"
eindent
( postassociate "${iface}" )
@@ -457,7 +437,7 @@ iwconfig_scan() {
veinfo "Scanning for access points"
# Sleep if required
- eval x=\"\$\{sleep_scan_${ifvar}\}\"
+ eval x=\"\$\{sleep_scan_${ifvar}\:-1}\"
[[ -n ${x} ]] && sleep "${x}"
local error=true i=-1 line