summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpbuetow <puppet@mx.buetow.org>2012-03-17 10:55:38 +0100
committerpbuetow <puppet@mx.buetow.org>2012-03-17 10:55:38 +0100
commitb314697216acdd0adf61d174125b8951059e10d9 (patch)
tree0771b1b768632b0556f9c61ee2e182292ecbfe40
parentdb1cdb1c45698006194c1bf545e1541f74795315 (diff)
Some minor tweak
-rwxr-xr-xloadbars9
1 files changed, 4 insertions, 5 deletions
diff --git a/loadbars b/loadbars
index 78cceba..d5f4de6 100755
--- a/loadbars
+++ b/loadbars
@@ -226,6 +226,10 @@ sub stats_thread ($;$) {
my $loadavgexp = qr/(\d+\.\d{2}) (\d+\.\d{2}) (\d+\.\d{2})/;
my $inter = INTERVAL;
+ # Toggle CPUs
+ $SIG{USR1} = sub { $sigusr1 = 1 };
+ $SIG{TERM} = sub { $sigterm = 1 };
+
until ($sigterm) {
my $bash = <<"BASH";
loadavg=/proc/loadavg
@@ -254,17 +258,12 @@ BASH
$PIDS{$pid} = 1;
- # Toggle CPUs
- $SIG{USR1} = sub { $sigusr1 = 1 };
- $SIG{TERM} = sub { $sigterm = 1 };
-
my $cpuregexp = qr/$I{cpuregexp}/;
# 1=cpu, 2=mem, 3=net
my $mode = 0;
while (<$pipe>) {
chomp;
-
if ($mode == 0) {
if ($_ eq 'MEMSTATS') {
$mode = 1;