mrtg/uptime.pl

Sat, 04 Apr 2009 22:40:04 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 04 Apr 2009 22:40:04 +0200
changeset 136
ca197d884ebd
parent 135
cd68ee26852b
child 138
3603322c3b20
permissions
-rw-r--r--

Correct DOS carriage returns at line endings to line feeds only.

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@136 6 $ZERO = 0;
michael@136 7 $uptime = `uptime`;
michael@136 8
michael@136 9 $uptime =~ /up (.*?) day/;
michael@136 10 $up = int($1);
michael@136 11 $hostname = `hostname`;
michael@136 12
michael@136 13 print "$ZERO\n$up\n"
michael@136 14

mercurial