Prevent globbing and word splitting

This commit is contained in:
Riyyi
2019-12-30 23:03:21 +01:00
parent dd8c4ac631
commit 9e1686fd99
2 changed files with 8 additions and 8 deletions
+5 -5
View File
@@ -4,8 +4,8 @@ ICON=""
WIRELESS="${1:-wlan0}"
if [ "$NOTIFY" = "1" ]; then
SSID="$(iw dev $WIRELESS link | awk '/SSID/ { print $2 }')"
IP="$(ip a show $WIRELESS \
SSID="$(iw dev "$WIRELESS" link | awk '/SSID/ { print $2 }')"
IP="$(ip a show "$WIRELESS" \
| awk '/inet / { print substr($2, 0, length($2) - 3) }')"
notify-send -r 3 "Wifi" "\
@@ -14,13 +14,13 @@ SSID: $SSID
IP: $IP"
else
COLOR="-"
if [ ! -d /sys/class/net/${WIRELESS}/wireless ] ||
[ "$(cat /sys/class/net/$WIRELESS/operstate)" = 'down' ]; then
if [ ! -d /sys/class/net/"$WIRELESS"/wireless ] ||
[ "$(cat /sys/class/net/"$WIRELESS"/operstate)" = 'down' ]; then
COLOR="$COLOR7"
DISPLAY="$ICON"
else
QUALITY=$(grep $WIRELESS /proc/net/wireless | \
QUALITY=$(grep "$WIRELESS" /proc/net/wireless | \
awk '{ print int($3 * 100 / 70) }')
COLOR="$COLOR15"