From fb948ee521c5102aedafc661fb4af5d432514f74 Mon Sep 17 00:00:00 2001 From: stanley lieber Date: Sun, 6 May 2012 21:51:12 -0500 Subject: [PATCH] add /rc/bin/sysinfo --- rc/bin/sysinfo | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 rc/bin/sysinfo diff --git a/rc/bin/sysinfo b/rc/bin/sysinfo new file mode 100755 index 000000000..0b8072769 --- /dev/null +++ b/rc/bin/sysinfo @@ -0,0 +1,49 @@ +#!/bin/rc +fn logprog{ + echo % `{echo $"* | sed 's/#/''#''/g'} + $* + echo + +} + +fn work{ + echo '% cd ''#ec''; for(i in *){echo $i ''='' `{cat $i}}' + cd '#ec'; for(i in *){echo $i '=' `{cat $i}} + echo + logprog cat '#P/archctl' + logprog cat '#P/irqalloc' + logprog cat '#P/ioalloc' + logprog cat '#c/config' + logprog cat '#c/swap' + logprog cat '#c/sysstat' + logprog awk '/^Plan 9$/{p=1} +/^init: starting/{exit} +{if(p)print}' '#c/kmesg' + logprog pci -v + logprog aux/icanhasmsi + logprog aux/pcmcia + logprog cat '#u/usb/ctl' + logprog cat '#S/sdctl' + for(i in '#S'/sd[A-Z][0-9]*/ctl) + logprog cat $i + for(i in '#l/ether'*){ + logprog cat $i/addr + logprog cat $i/stats + logprog cat $i/ifstats + } + logprog cat '#v/vgactl' + echo '@{rfork n; aux/realemu; aux/vga -p}' + @{rfork n; aux/realemu; aux/vga -p} + logprog xd -x1 '#r/nvram' + logprog cat '#A/audiostat' + logprog cat '#A/volume' + logprog cat /mnt/apm/ctl +} + +switch($1){ +case -m + {echo Subject: `{cat '#P/cputype'}; work} >[2=1] | + upas/smtp 9front.org $user hardware@9front.org +case * + work +}