diff --git a/status-update b/status-update index 20ec9b8..68e3682 100755 --- a/status-update +++ b/status-update @@ -1,7 +1,18 @@ #!/bin/sh +for ifname in $(ls /sys/class/net/ | grep -v 'lo') +do + if ! [ -f "/sys/class/net/$ifname/operstate" ] + then + >&2 echo "$ifname has no operstate" + continue + fi + IF_STATUS=$(cat /sys/class/net/$ifname/operstate) + IF_STATE_LIST+=("$ifname: $IF_STATUS") +done + DATE="$(date +"%F %H:%M" )" -NETWORK="eth: $(cat /sys/class/net/enp34s0/operstate)" +NETWORK="${IF_STATE_LIST[*]}" SPACE="$(cat $HOME/.cache/free-space)" vol_status="$(cat $HOME/.cache/audio-control/vol_status)" vol_level="$(cat $HOME/.cache/audio-control/vol_level)%"