From d63d7d1015caea4534c6c227b8d1303a046e3bde Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sun, 10 Sep 2017 20:50:55 +0200 Subject: [PATCH] Slightly improve networking script. --- bin/network.sh | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) 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 -- 2.30.2