[BACK]Return to post_dmesg_to_nycbug CVS log [TXT][DIR] Up to [local] / openbsd / update_openbsd

Annotation of openbsd/update_openbsd/post_dmesg_to_nycbug, Revision 1.1

1.1     ! andrew      1: #!/usr/bin/perl
        !             2: use strict;
        !             3: use warnings;
        !             4: use feature 'say';
        !             5:
        !             6: use HTTP::Tiny;
        !             7:
        !             8: # This script posts your OpenBSD dmesg to the NYC*BUG dmesg archive.
        !             9:
        !            10: open my $de, '-|', qw( sysctl -n hw.vendor hw.product hw.version ) or die $!;
        !            11: my $description = join ' ', split /\s+/s,
        !            12:     do { local $/ = undef; readline $de };
        !            13: close $de or die $!;
        !            14:
        !            15: open my $dm, '<', '/var/run/dmesg.boot' or die $!;
        !            16: my $dmesg = do { local $/ = undef; readline $dm };
        !            17: close $dm;
        !            18:
        !            19: # Remove leftover cruft from previous boots
        !            20: $dmesg =~ s/^.*\n(OpenBSD )/$1/s;
        !            21:
        !            22: my $res = HTTP::Tiny->new->post_form(
        !            23:     'http://www.nycbug.org/index.cgi',
        !            24:     {   action      => 'dmesgd',
        !            25:         do          => 'addd',
        !            26:         nickname    => 'afresh1',
        !            27:         email       => 'andrew+dmesgd@afresh1.com',
        !            28:         description => $description,
        !            29:         dmesg       => $dmesg,
        !            30:     }
        !            31: );
        !            32:
        !            33: say $res->{success}
        !            34:     ? 'Sent dmesg'
        !            35:     : "Unable to send dmesg: $res->{status} $res->{reason}";

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>