From: Christian Heller Date: Sun, 10 Sep 2017 18:50:55 +0000 (+0200) Subject: Slightly improve networking script. X-Git-Url: https://plomlompom.com/repos/te"st.html?a=commitdiff_plain;h=d63d7d1015caea4534c6c227b8d1303a046e3bde;p=config Slightly improve networking script. --- diff --git a/bin/network.sh b/bin/network.sh index cfaf39f..37514c1 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 @@ -64,7 +51,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