packages/tollgate.scm: tollgate-wrt built with Guix's Go 1.24 (static, GOARCH from the target), Go modules from a reproducible fixed-output download, TollGate's OpenWrt files under share/ with store paths. packages/tollgate-services.scm: tollgate-service-type (procd init script via openwrt-rc, its uci-defaults at first boot, mutable /etc/tollgate, hotplug, jq, pulls in nodogsplash). procd-compat gains logread and /etc/openwrt_release. Verified: setup applied (TollGate SSID, uhttpd :8080, tcp 2121, nodogsplash on), the :2121 API returns its signed advertisement, `tollgate status' ok (PITFALLS #48). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
615 B
Bash
Executable File
26 lines
615 B
Bash
Executable File
#!/bin/sh
|
|
# logread: OpenWrt's log reader (ubox's logd), over Guix's syslog file.
|
|
# Supports -e PATTERN (extended regexp), -l COUNT (last lines), -f (follow);
|
|
# other ubox options are accepted and ignored.
|
|
LOG=/var/log/messages
|
|
pattern= lines= follow=
|
|
while getopts "e:l:fFs:p:r:u:t:h:z:Z0q" opt; do
|
|
case "$opt" in
|
|
e) pattern="$OPTARG" ;;
|
|
l) lines="$OPTARG" ;;
|
|
f) follow=1 ;;
|
|
esac
|
|
done
|
|
if [ -n "$follow" ]; then
|
|
set -- tail -n "${lines:-10}" -F "$LOG"
|
|
elif [ -n "$lines" ]; then
|
|
set -- tail -n "$lines" "$LOG"
|
|
else
|
|
set -- cat "$LOG"
|
|
fi
|
|
if [ -n "$pattern" ]; then
|
|
"$@" | grep -E -- "$pattern"
|
|
else
|
|
"$@"
|
|
fi
|