X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=bin%2Fnetwork.sh;h=0fedca25832a78e91bf4a98c45147765aacab319;hb=f8f2d363c9a5aa6d169ef2e246d7849d0da21cea;hp=cfaf39f827e605df90a58bb23f3a097610b061e5;hpb=c483f0e1c35f408e70f31f8855fcd80abdbd963c;p=config diff --git a/bin/network.sh b/bin/network.sh index cfaf39f..0fedca2 100755 --- a/bin/network.sh +++ b/bin/network.sh @@ -5,24 +5,11 @@ wifi_interface=wls1 ensure_wifi_on() { if [ ! "$(wifi)" = "wifi = on" ]; then - wifi on + #wifi on ip link set "$wifi_interface" up fi } -print_usage() { - echo 'Available commands:' - echo ' eth_connect' - echo ' eth_disconnect' - echo ' wifi_scan' - echo ' wifi_connect_open SSID' - echo ' wifi_set_wpa SSID KEY' - echo ' wifi_connect_wep_ascii SSID KEY' - echo ' wifi_connect_wep_hex SSID KEY' - echo ' wifi_connect_wpa SSID KEY' - echo ' wifi_disconnect' -} - if ! echo "${1}"; then echo 'No command given.' print_usage @@ -43,6 +30,8 @@ elif [ "${1}" = 'wifi_connect_open' ]; then ensure_wifi_on iw dev "$wifi_interface" connect "${2}" #dhclient "$wifi_interface" + #ip route delete default + #ip route add default via 192.168.1.1 dev wls1 elif [ "${1}" = 'wifi_connect_wep_ascii' ]; then ensure_wifi_on @@ -64,7 +53,13 @@ elif [ "${1}" = 'wifi_disconnect' ]; then ip link set "$wifi_interface" down else - echo 'Unknown command.' - print_usage - exit 1 + echo 'Available commands:' + echo ' eth_connect' + echo ' eth_disconnect' + echo ' wifi_scan' + echo ' wifi_connect_open SSID' + echo ' wifi_connect_wep_ascii SSID KEY' + echo ' wifi_connect_wep_hex SSID KEY' + echo ' wifi_connect_wpa SSID KEY' + echo ' wifi_disconnect' fi