2012-05-26 19:50:10 +00:00
|
|
|
#!/bin/rc
|
|
|
|
rfork e
|
2013-02-16 02:52:33 +00:00
|
|
|
fn logprog{
|
|
|
|
echo % `{echo $"* | sed 's/#/''#''/g'}
|
|
|
|
$*
|
|
|
|
echo
|
|
|
|
}
|
2013-07-05 00:52:12 +00:00
|
|
|
fn print{
|
2013-02-16 02:52:33 +00:00
|
|
|
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'
|
2014-09-21 16:28:35 +00:00
|
|
|
logprog awk '/^Plan 9/{p=1}
|
2013-02-16 02:52:33 +00:00
|
|
|
/^init: starting/{exit}
|
|
|
|
{if(p)print}' '#c/kmesg'
|
|
|
|
logprog pci -v
|
2014-07-11 21:20:15 +00:00
|
|
|
logprog aux/cpuid
|
2013-02-16 02:52:33 +00:00
|
|
|
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 '#l0/ether0' '#l1/ether1' '#l2/ether2' '#l3/ether3'){
|
|
|
|
if(test -e $i){
|
|
|
|
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
|
|
|
|
}
|
2013-07-05 00:52:12 +00:00
|
|
|
fn post{
|
|
|
|
file=/tmp/sysinfo.$user.$pid
|
2013-07-05 19:42:45 +00:00
|
|
|
if(! ~ $#e 0)
|
|
|
|
echo $e >$file
|
|
|
|
print >>$file >[2=1]
|
2013-07-05 00:52:12 +00:00
|
|
|
@{
|
|
|
|
rfork n
|
|
|
|
webfs
|
|
|
|
hpost -u http://sysinfo.9front.org -p / a_body@$file submit:submit fake:fake a_func:add_post url: |
|
|
|
|
grep -e '\/body\"' |
|
|
|
|
sed 1q | sed 's/^.*href=\"//g; s/body\".*$/body/g; s/^/http:\/\/sysinfo.9front.org/g'
|
|
|
|
rm -f $file
|
|
|
|
}
|
|
|
|
}
|
2013-07-05 19:42:45 +00:00
|
|
|
argv0=$0
|
|
|
|
fn usage {
|
|
|
|
echo usage: $argv0 '[ -e e-mail ] [ -p ]' >[1=2]
|
|
|
|
exit usage
|
|
|
|
}
|
|
|
|
e=()
|
|
|
|
p=()
|
|
|
|
while(~ $1 -*){
|
|
|
|
switch($1){
|
|
|
|
case -e
|
|
|
|
e=$2
|
|
|
|
shift
|
|
|
|
case -p
|
|
|
|
p=1
|
|
|
|
shift
|
|
|
|
case *
|
|
|
|
usage
|
|
|
|
}
|
|
|
|
shift
|
|
|
|
}
|
|
|
|
if(~ $p 1)
|
2013-07-05 00:52:12 +00:00
|
|
|
post
|
|
|
|
|
2013-07-05 19:42:45 +00:00
|
|
|
if not
|
2013-07-05 00:52:12 +00:00
|
|
|
print
|