From 76677bb8f0d1b5f5dd620de995c0c27c6494e93b Mon Sep 17 00:00:00 2001 From: stanley lieber Date: Thu, 4 Jul 2013 20:52:12 -0400 Subject: sysinfo: remove -m, add -p, which posts output at http://sysinfo.9front.org, which forwards the information to 9front-sysinfo@9front.org mailing list --- rc/bin/sysinfo | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'rc') diff --git a/rc/bin/sysinfo b/rc/bin/sysinfo index a071458c3..5f8843f22 100755 --- a/rc/bin/sysinfo +++ b/rc/bin/sysinfo @@ -7,7 +7,7 @@ fn logprog{ echo } -fn work{ +fn print{ echo '% cd ''#ec''; for(i in *){echo $i ''='' `{cat $i}}' cd '#ec'; for(i in *){echo $i '=' `{cat $i}} echo @@ -43,10 +43,23 @@ fn work{ logprog cat /mnt/apm/ctl } +fn post{ + file=/tmp/sysinfo.$user.$pid + print >$file >[2=1] + @{ + 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 + } +} + switch($1){ -case -m - {echo Subject: `{cat '#P/cputype'}; work} >[2=1] | - user=/dev/null upas/smtp 9front.org $user hardware@9front.org +case -p + post + case * - work + print } -- cgit v1.2.3 From 252b0ff3c9b17628e641f2e9eb84468fb8975a6e Mon Sep 17 00:00:00 2001 From: stanley lieber Date: Fri, 5 Jul 2013 15:42:45 -0400 Subject: sysinfo: add -e to include a reply-to e-mail address --- rc/bin/sysinfo | 34 +++++++++++++++++++++++++--------- sys/man/1/sysinfo | 10 +++++++++- 2 files changed, 34 insertions(+), 10 deletions(-) (limited to 'rc') diff --git a/rc/bin/sysinfo b/rc/bin/sysinfo index 5f8843f22..8905368f8 100755 --- a/rc/bin/sysinfo +++ b/rc/bin/sysinfo @@ -1,12 +1,10 @@ #!/bin/rc rfork e - fn logprog{ echo % `{echo $"* | sed 's/#/''#''/g'} $* echo } - fn print{ echo '% cd ''#ec''; for(i in *){echo $i ''='' `{cat $i}}' cd '#ec'; for(i in *){echo $i '=' `{cat $i}} @@ -42,10 +40,11 @@ fn print{ logprog cat '#A/volume' logprog cat /mnt/apm/ctl } - fn post{ file=/tmp/sysinfo.$user.$pid - print >$file >[2=1] + if(! ~ $#e 0) + echo $e >$file + print >>$file >[2=1] @{ rfork n webfs @@ -55,11 +54,28 @@ fn post{ rm -f $file } } - -switch($1){ -case -p +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) post -case * +if not print -} diff --git a/sys/man/1/sysinfo b/sys/man/1/sysinfo index 4b976d5d8..01f96517f 100644 --- a/sys/man/1/sysinfo +++ b/sys/man/1/sysinfo @@ -4,6 +4,9 @@ sysinfo, sysupdate \- report information about, update the system .SH SYNOPSIS .B sysinfo [ +.B -e e-mail +] +[ .B -p ] .br @@ -27,7 +30,12 @@ which in turn forwards the message to a mailing list, .B 9front-sysinfo@9front.org. A URL pointing to the archived output is returned. -This flag is useful for reporting new installs to the +The +.B -e +flag causes a reply-to e-mail address to be included +in the message (the e-mail address is not divulged +to the mailing list). +These flags are useful for reporting new installs to the development team. .PP .I Sysupdate -- cgit v1.2.3