blob: 396faa6399c283b680b17f5148d0fc6a4769c544 (
plain) (
tree)
|
|
#!/bin/sh
icon_ethernet=
icon_down=
icon_wireless=
is_ethernet=$(ifconfig em0 | grep status | cut -d\: -f2)
if [ "$is_ethernet" = " active" ]; then
inet=$(ifconfig lagg0 | grep inet\ | cut -w -f3)
printf "%s%s\n" $icon_ethernet $inet
elif [ "$(ifconfig wlan0 | grep status | cut -d\: -f2)" = " associated" ]; then
ssid=$(ifconfig wlan0 | sed -n 's/^.*ssid \(.*\) channel.*$/\1/p')
[ -n "$ssid" ] && printf "%s%s" $icon_wireless "$ssid"
else
printf "%sNo connection" $icon_down
fi
printf "\n"
|