From f5f47bf26a3d4fdae0480fb3614e3a9f24ef1085 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 12 Jun 2013 23:58:52 +0200 Subject: looping now cracks over networks --- usr/bin/autowifi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'usr/bin/autowifi') diff --git a/usr/bin/autowifi b/usr/bin/autowifi index d9337cf4..6fb64f95 100755 --- a/usr/bin/autowifi +++ b/usr/bin/autowifi @@ -116,6 +116,21 @@ loop_over_cracks(){ done return 1 } +loop_cracks_over_networks(){ + wifi_init + for crack in $(find $crackdir -type f | sort -u); do + for i in `seq 1 $WIFI_COUNT`; do + KEY="$(eval root=$root \$crack \"\${ESSID_${i}}\" \"\${MAC_${i}}\" \${FREQ_${i}} \${ENCRYPTION_${i}})" + if [ $? -eq 0 ]; then + eval connect \"\${MAC_${i}}\" \"\${ESSID_${i}}\" \${ENCRYPTION_${i}} \"\${KEY}\" + if [ $? -eq 0 ]; then + return 0 + fi + fi + done + done + +} #scan_all(){ # for i in `seq 1 $WIFI_COUNT`; do @@ -155,11 +170,11 @@ elif [ -n "$1" ]; then connect_to_network_by_ssid "$1" else echo looping network now - check_internet || loop_over_networks + check_internet || loop_cracks_over_networks while sleep 60; do if ! check_internet; then - loop_over_networks + loop_cracks_over_networks fi done fi -- cgit v1.2.3