version 1.1, 2015/02/22 19:22:08 |
version 1.5, 2015/03/03 18:56:08 |
|
|
use warnings; |
use warnings; |
use feature 'say'; |
use feature 'say'; |
|
|
|
use Sys::Hostname; |
use HTTP::Tiny; |
use HTTP::Tiny; |
|
|
# This script posts your OpenBSD dmesg to the NYC*BUG dmesg archive. |
# This script posts your OpenBSD dmesg to the NYC*BUG dmesg archive. |
|
|
open my $de, '-|', qw( sysctl -n hw.vendor hw.product hw.version ) or die $!; |
my $nickname = "$ENV{USER}"; |
my $description = join ' ', split /\s+/s, |
my $email = "$ENV{USER}\@" . hostname(); |
do { local $/ = undef; readline $de }; |
|
close $de or die $!; |
|
|
|
|
my @sysctls = ( |
|
[qw( hw.vendor hw.product hw.version )], |
|
[qw( hw.model )], |
|
); |
|
|
|
my $description = "@ARGV"; |
|
|
|
while ( @sysctls and not $description ) { |
|
my @s = @{ shift @sysctls }; |
|
|
|
open my $de, '-|', qw( sysctl -n ), @s or die $!; |
|
$description = join ' ', split /\s+/s, |
|
do { local $/ = undef; readline $de }; |
|
close $de or die $!; |
|
} |
|
|
|
print "About to post '$description', OK? "; |
|
readline STDIN; |
|
|
open my $dm, '<', '/var/run/dmesg.boot' or die $!; |
open my $dm, '<', '/var/run/dmesg.boot' or die $!; |
my $dmesg = do { local $/ = undef; readline $dm }; |
my $dmesg = do { local $/ = undef; readline $dm }; |
close $dm; |
close $dm; |
|
|
'http://www.nycbug.org/index.cgi', |
'http://www.nycbug.org/index.cgi', |
{ action => 'dmesgd', |
{ action => 'dmesgd', |
do => 'addd', |
do => 'addd', |
nickname => 'afresh1', |
nickname => $nickname, |
email => 'andrew+dmesgd@afresh1.com', |
email => $email, |
description => $description, |
description => $description, |
dmesg => $dmesg, |
dmesg => $dmesg, |
} |
} |