mrtg/uptime.pl

Tue, 28 Aug 2012 18:32:05 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:32:05 +0200
changeset 552
e568963742d6
parent 160
1a36468e720c
permissions
-rw-r--r--

Correct detection of GCC sync_fetch_and_add atomic builtins, update the
version, modernize packaging, add new prompts, and correct sound paths.
The vendor configure script checks for sync_fetch_and_add and reports
success because strangely GCC only fails when returning the return value
of the builtin function in the consumer function.

michael@176 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@160 13 # According to http://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html
michael@160 14 # 'the external command must return 4 lines of output.'
michael@138 15 print "$up\n";
michael@138 16 print "$up\n";
michael@138 17 print "$null\n";
michael@160 18 print "$null\n";
michael@136 19

mercurial