mrtg/uptime.pl

Sat, 04 Apr 2009 23:05:27 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 04 Apr 2009 23:05:27 +0200
changeset 138
3603322c3b20
parent 136
ca197d884ebd
child 160
1a36468e720c
permissions
-rw-r--r--

Correct interface logic of uptime(1) formatting script.

michael@136 1 #!@l_prefix@/bin/perl
michael@136 2 ##
michael@136 3 ## uptime.pl: provide formatted uptime(1) information
michael@136 4 ##
michael@136 5
michael@138 6 $null = 0;
michael@136 7 $uptime = `uptime`;
michael@138 8 $hostname = `hostname`;
michael@136 9
michael@136 10 $uptime =~ /up (.*?) day/;
michael@136 11 $up = int($1);
michael@136 12
michael@138 13 print "$up\n";
michael@138 14 print "$up\n";
michael@138 15 print "$null\n";
michael@136 16

mercurial