diff options
author | makefu <github@syntax-fehler.de> | 2013-06-26 13:26:56 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2013-06-26 13:26:56 +0200 |
commit | ae52241d3802079628a87a534ce1853d1d46c82a (patch) | |
tree | 9b37886b3ce86da81febfe3594c8a31b5694870f /usr/bin/autowifi | |
parent | 410ddbd1f77e2f65de6e6b6c86daf031e296028d (diff) | |
parent | a0f4644017949e17b45f23a3870afa6f6c2823cb (diff) |
Merge branch 'master' of github.com:krebscode/autowifi
Diffstat (limited to 'usr/bin/autowifi')
-rwxr-xr-x | usr/bin/autowifi | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/usr/bin/autowifi b/usr/bin/autowifi index 1969e650..5de46f41 100755 --- a/usr/bin/autowifi +++ b/usr/bin/autowifi @@ -114,6 +114,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 @@ -151,11 +166,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 |