summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-10-27 12:54:54 -0400
committerJesse Luehrs <doy@tozt.net>2018-10-27 12:54:54 -0400
commit5b7384cc2b2760ca45165ef9f6e62a791e59944f (patch)
treea0cd58252d3c7dc8a32f0610790b3a77c7294a28 /bin
parent5574904bfbc614df7b10965fd445ddf33ea5d86e (diff)
downloadconf-5b7384cc2b2760ca45165ef9f6e62a791e59944f.tar.gz
conf-5b7384cc2b2760ca45165ef9f6e62a791e59944f.zip
fix up using wifi with no arguments
Diffstat (limited to 'bin')
-rwxr-xr-xbin/wifi6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/wifi b/bin/wifi
index 4253a30..38c70ee 100755
--- a/bin/wifi
+++ b/bin/wifi
@@ -5,16 +5,16 @@ set -o pipefail
DEV=wlp3s0
OPEN=open
-if [ -z "$1" ]; then
+if [ -z "${1:-}" ]; then
if sudo netctl status $OPEN > /dev/null 2>&1; then
sudo netctl restart $OPEN
else
sudo systemctl restart netctl-auto@$DEV
fi
else
- case $1 in
+ case "$1" in
open)
- if [ -n "$2" ]; then
+ if [ -n "${2:-}" ]; then
sudo sed -i "s/^ESSID=.*/ESSID='${2}'/" "/etc/netctl/${OPEN}"
fi