aboutsummaryrefslogtreecommitdiff
path: root/status-openbsd
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-07-10 11:51:20 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-07-11 07:19:07 +0200
commit500da620557e19c334882e50ffbd92d6e53a4b76 (patch)
tree5d14def7b61ca31453d5ec66f5bc7f47c0ca6b5d /status-openbsd
parentaf818b134f81cb25fbc6bd1c969c39f7920500ef (diff)
downloadscripts-500da620557e19c334882e50ffbd92d6e53a4b76.tar.gz
scripts-500da620557e19c334882e50ffbd92d6e53a4b76.zip
status for OpenBSD
Diffstat (limited to '')
-rwxr-xr-xstatus-openbsd20
1 files changed, 20 insertions, 0 deletions
diff --git a/status-openbsd b/status-openbsd
new file mode 100755
index 0000000..1f88b50
--- /dev/null
+++ b/status-openbsd
@@ -0,0 +1,20 @@
1#!/bin/sh
2
3# Prints some status info to stdout. Includes:
4# - date and time
5# - battery
6# - wifi (requires ifconfig on OpenBSD)
7
8# Usage: status [separator]
9
10sep=${1:-" | "}
11
12time=$(date +"%H:%M")
13date=$(date +"%d %B %Y")
14battery="$(apm | grep -o '[^ ]*%')"
15network="$(ifconfig athn0 | grep status | sed 's/.*status: //')"
16if [ "$network" = "active" ]; then
17 network="$(ifconfig athn0 | grep nwid | sed 's/.*nwid //;s/ chan.*//')"
18fi
19
20echo "$network$sep$battery$sep$date$sep$time"

Generated with cgit - Back to sebastiano.tronto.net