I am trying to pipe a script to my statusbar in linux via dwm window manager and have it working fine but wanted to have a command echo "multiple" if i have more than one interface name up at the same time. This is what i have come up with so far but it doesnt want to echo "multiple" when running the script if wlan0 and usb0 are up at the same time? any help much appreciated.
#!/bin/bash
a=$(ifconfig | grep -ow "wlan0")
b="wlan0"
c=$(ifconfig | grep -ow "usb0")
d="usb0"
e=$(ifconfig | grep -ow 'usb0\|wlan0')
f="usb0\nwlan0"
if [[ "$a" == "$b" ]] ; then
echo -e "${b}"
elif [[ "$c" == "$d" ]] ; then
echo -e "${d}"
elif [[ "$e" == "$f" ]] ; then
echo "multiple"
else
echo "not connected"
fi