summaryrefslogtreecommitdiffstats
path: root/usr/lib/autowifi/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'usr/lib/autowifi/plugins')
-rwxr-xr-xusr/lib/autowifi/plugins/00profile2
-rwxr-xr-xusr/lib/autowifi/plugins/01open4
-rwxr-xr-xusr/lib/autowifi/plugins/30default_wps13
3 files changed, 15 insertions, 4 deletions
diff --git a/usr/lib/autowifi/plugins/00profile b/usr/lib/autowifi/plugins/00profile
index fdba2c9e..d7fb9c75 100755
--- a/usr/lib/autowifi/plugins/00profile
+++ b/usr/lib/autowifi/plugins/00profile
@@ -3,7 +3,7 @@
# ENV:
# root (default: /)
root=${root:-/}
-cat $root/etc/autowifi/wifi_keys 2>/dev/null | (while IFS='|' read SSID MAC KEY; do
+cat $root/etc/autowifi/wifi_keys 2>/dev/null | (while IFS='|' read SSID MAC BANDWIDTH KEY; do
if [ "$1" == "$SSID" -a "$2" == "$MAC" ]; then
echo $KEY
exit 0
diff --git a/usr/lib/autowifi/plugins/01open b/usr/lib/autowifi/plugins/01open
index f3b9640c..881f47ea 100755
--- a/usr/lib/autowifi/plugins/01open
+++ b/usr/lib/autowifi/plugins/01open
@@ -1,6 +1,6 @@
#!/bin/sh
-#ESSID MAC CHANNEL ENCRYPTION WPA WPA2
-if [ "$4" == "off" ]; then
+#ESSID MAC CHANNEL ENCRYPTION
+if [ "$4" == "[ESS]" ]; then
exit 0
fi
exit 1
diff --git a/usr/lib/autowifi/plugins/30default_wps b/usr/lib/autowifi/plugins/30default_wps
index 98be6a66..7f66d117 100755
--- a/usr/lib/autowifi/plugins/30default_wps
+++ b/usr/lib/autowifi/plugins/30default_wps
@@ -3,4 +3,15 @@
# http://www.wotan.cc/?p=75
cd $(dirname $(readlink -f $0))
. ../lib/wps
-try_wps_pin "$@" 12345670
+. ../lib/plugin_core
+
+parse_plugin_args "$@"
+DEFAULT_PIN="${DEFAULT_PIN:-12345670}"
+
+if has_wps "$ENC"; then
+ echo "trying PIN $DEFAULT_PIN against $ESSID" >&2
+ try_wps_pin "$@" $DEFAULT_PIN
+else
+ echo "Network $ESSID not WPS enabled" >&2
+ exit 1
+fi