From 270c82cb22ea22e6049f544403ad459d9d6604e3 Mon Sep 17 00:00:00 2001
From: lassulus <lassulus@googlemail.com>
Date: Fri, 24 May 2013 10:25:22 +0200
Subject: beta test of heckenkrebs

---
 usr/bin/autowifi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

(limited to 'usr/bin/autowifi')

diff --git a/usr/bin/autowifi b/usr/bin/autowifi
index f6e26a1e..10f4a9e2 100755
--- a/usr/bin/autowifi
+++ b/usr/bin/autowifi
@@ -53,6 +53,27 @@ iwlist_scan(){
         esac
     done; echo WIFI_COUNT=$count)
 }
+crack_wifi(){
+    for hack in $(ls /usr/lib/autowifi/); do
+        key=$($hack $@);
+        if ! [ $key -eq 1 ];then
+            break
+        else
+            connect_wifi $3 $1 
+        fi
+    done
+}
+check_internet(){
+    wget -O- --spider http://google.de/index.html
+}
+loop_over_networks(){
+    . /tmp/${wifi}.scan
+    for i in `seq 1 $WIFI_COUNT`; do
+        crack_wifi \${ESSID_${i}} \${MAC_${i}} \${CHANNEL_${i}} \${ENCRYPTION_${i}} \${WPA_${i}} \${WPA2_${i}}
+    done
+
+}
 
 iwlist_scan > /tmp/${wifi}.scan
+loop_over_networks
 
-- 
cgit v1.2.3