aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-09-29 21:32:11 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-09-29 21:32:11 +0200
commit31a433b6a68cf924b70039abc6464453c323acf2 (patch)
tree7d03697cff3497f2263c2ae85a5d0052585d6573
parente159d98f4389721d7a5e0c37cba3227dab3cb447 (diff)
parentc04498863e591792678d4facc81b07a1c082714c (diff)
downloadscripts-31a433b6a68cf924b70039abc6464453c323acf2.tar.gz
scripts-31a433b6a68cf924b70039abc6464453c323acf2.zip
Merge branch 'master' of tronto.net:scripts
-rwxr-xr-xstatus-openbsd12
1 files changed, 9 insertions, 3 deletions
diff --git a/status-openbsd b/status-openbsd
index 1f88b50..6382053 100755
--- a/status-openbsd
+++ b/status-openbsd
@@ -10,11 +10,17 @@
10sep=${1:-" | "} 10sep=${1:-" | "}
11 11
12time=$(date +"%H:%M") 12time=$(date +"%H:%M")
13date=$(date +"%d %B %Y") 13date=$(date +"%d %b")
14battery="$(apm | grep -o '[^ ]*%')" 14battery="$(apm | grep -o '[^ ]*%')"
15network="$(ifconfig athn0 | grep status | sed 's/.*status: //')" 15ifconfig="$(ifconfig athn0)"
16network="$(echo "$ifconfig" | grep status | sed 's/.*status: //')"
16if [ "$network" = "active" ]; then 17if [ "$network" = "active" ]; then
17 network="$(ifconfig athn0 | grep nwid | sed 's/.*nwid //;s/ chan.*//')" 18 nwid="$(echo "$ifconfig" | grep nwid | sed 's/.*nwid //;s/ chan.*//')"
19 if [ -z "$nwid" ]; then
20 nwid="$(echo "$ifconfig" | grep ieee80211 | \
21 sed 's/.*ieee80211: join //' | sed 's/ chan.*//')"
22 fi
18fi 23fi
24network="$(printf "%.20s" "$nwid")" # Make it shorter
19 25
20echo "$network$sep$battery$sep$date$sep$time" 26echo "$network$sep$battery$sep$date$sep$time"

Generated with cgit - Back to sebastiano.tronto.net