diff options
author | makefu <github@syntax-fehler.de> | 2013-06-10 21:10:01 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2013-06-10 21:10:06 +0200 |
commit | 3fa01e1d01e3235e218370f3afd3f2f2344c8b01 (patch) | |
tree | 2514cf3b5f5991a197570d05da88fc42b17dad17 /usr/bin/autowifi | |
parent | 04457e14918e7b2a99fc2d6243f004d8452977e3 (diff) |
write head correctly
Diffstat (limited to 'usr/bin/autowifi')
-rwxr-xr-x | usr/bin/autowifi | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/usr/bin/autowifi b/usr/bin/autowifi index f0bfd83d..19eabffd 100755 --- a/usr/bin/autowifi +++ b/usr/bin/autowifi @@ -6,6 +6,7 @@ interface=${interface:-wlan0} root=${root:-../../} crackdir=$root/usr/lib/autowifi/plugins wifi_keys=$root/etc/autowifi/wifi_keys +wifi_log=$root/var/log/autowifi.log # exists() run_hooks() . $root/usr/lib/autowifi/lib/core @@ -21,12 +22,12 @@ wifi_keys=$root/etc/autowifi/wifi_keys connect(){ #mac ssid encryption key - run_hooks interface pre - run_hooks profile pre + run_hooks interface pre + run_hooks profile pre - connect_wifi "$@" + connect_wifi "$@" - ip_start dhcp + ip_start dhcp if check_gateway && check_internet; then echo yay internet >&2 @@ -41,7 +42,7 @@ connect(){ } write_profile(){ bandw=$(check_bandwidth) - (echo "#SSID|MAC|BANDWIDTH|KEY"; cat $wifi_keys | grep -v '^#' | grep -v "|$1|" ; echo "$2|$1|$bandw|$4" ) | sort | uniq > "${wifi_keys}2" + ( cat $wifi_keys | grep -v '^#' | grep -v "|$1|" ; echo "$2|$1|$bandw|$4" ) | ( echo "#SSID|MAC|BANDWIDTH|KEY";sort )| uniq > "${wifi_keys}2" mv "${wifi_keys}2" "$wifi_keys" } @@ -149,8 +150,8 @@ elif [ -n "$1" ]; then echo connecting to $1 connect_to_network_by_ssid "$1" else - echo looping network now - loop_over_networks + echo looping network now + check_internet || loop_over_networks while sleep 60; do if ! check_internet; then loop_over_networks |