summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2013-05-24 17:30:02 +0200
committerlassulus <lassulus@googlemail.com>2013-05-24 17:30:02 +0200
commit729eb44eca98c772c0def8a1cd41fa52763d0663 (patch)
tree63a1789235f5a5787098047ef8f3f661370ea4e5 /usr
parent2bafe012acd61e90a4a3481f004a71a0378506c1 (diff)
shorter wait, fixed loop
Diffstat (limited to 'usr')
-rwxr-xr-xusr/bin/autowifi5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr/bin/autowifi b/usr/bin/autowifi
index 46a3b7f9..8c5a0101 100755
--- a/usr/bin/autowifi
+++ b/usr/bin/autowifi
@@ -88,7 +88,7 @@ crack_wifi(){
ret=$?
if [ $ret -eq 0 ];then
connect_wifi "$3" "$1" $encr "$key"
- sleep 20
+ sleep 5
if check_gateway; then
(cat /etc/autowifi/wifi_keys | grep -v "$1|$2|" ; echo "$1|$2|$key" ) | sort | uniq > /etc/autowifi/wifi_keys2
mv /etc/autowifi/wifi_keys2 /etc/autowifi/wifi_keys
@@ -97,6 +97,7 @@ crack_wifi(){
fi
fi
done
+ return 1
}
check_gateway(){
ping -c 1 -w 5 $(ip route | awk '/default/{print $3}')
@@ -108,7 +109,7 @@ loop_over_networks(){
. /tmp/${wifi}.scan
for i in `seq 1 $WIFI_COUNT`; do
eval grep -q \${MAC_${i}} /etc/autowifi/blacklist && continue
- eval crack_wifi "\${ESSID_${i}}" \${MAC_${i}} \${CHANNEL_${i}} \${ENCRYPTION_${i}} \${WPA_${i}} \${WPA2_${i}}
+ eval crack_wifi "\${ESSID_${i}}" \${MAC_${i}} \${CHANNEL_${i}} \${ENCRYPTION_${i}} \${WPA_${i}} \${WPA2_${i}} && break
done
}