summaryrefslogtreecommitdiff
path: root/wls
diff options
context:
space:
mode:
authorTslil Clingman <tslil.clingman@gmail.com>2017-05-28 17:32:03 -0500
committerTslil Clingman <tslil.clingman@gmail.com>2017-05-28 17:32:03 -0500
commit721668ea57fda4254ceee9146c6b6bee470b3fc6 (patch)
treef0f7a8078c601d47dd521567749b215f9ca36373 /wls
parent6d1077a28b8d6f64ca72b9aa00f0b2cab97fb594 (diff)
Ran shellcheck, fixed (?) things
Diffstat (limited to 'wls')
-rwxr-xr-xwls24
1 files changed, 12 insertions, 12 deletions
diff --git a/wls b/wls
index 62cf55a..5889f9b 100755
--- a/wls
+++ b/wls
@@ -12,34 +12,34 @@ connect() {
dird="${HOME}/.config/wireless"
-sudo killall wpa_supplicant &> /dev/null
-sudo dhcpcd -k $dev &> /dev/null
-sudo ip link set $dev up &> /dev/null
+sudo killall wpa_supplicant
+sudo dhcpcd -k $dev
+sudo ip link set $dev up
ssids=$(sudo iw dev $dev scan | grep SSID | cut -d\ -f 2-)
for s in $ssids; do
if [ -f "$dird/$s" ]; then
echo -n "Connect to $s? [y]/* "
- y=""; read y;
- if [ -z $y ]; then
+ y=""; read -r y;
+ if [ -z "$y" ]; then
connect "$dird/$s"
exit 0;
fi;
fi;
done;
-ls $dird
+ls "$dird"
echo -n "--> "
-read ssid
+read -r ssid
if [ ! -f "$dird/$ssid" ]; then
echo Creating new network profile, enter passphrase:
- read pass
- wpa_passphrase $ssid "$pass" > $dird/$ssid
+ read -r pass
+ wpa_passphrase "$ssid" "$pass" > "$dird"/"$ssid"
echo -n "Edit file (y/[n])? "
- read edit
- if [ "$edit" == "y" ]; then
- $EDITOR $dird/$ssid
+ read -r edit
+ if [ "$edit" = "y" ]; then
+ $EDITOR "$dird"/"$ssid"
fi;
fi;