It probably doesn't matter much as the get_memory_consumption function just returns 0 when no pids are found. But it shouldn't even try as the mem var is never used when the service is not running.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
@pids = &General::find_pids("${process}");
}
- # Get memory consumption
- my $mem = &General::get_memory_consumption(@pids);
-
print <<EOF;
<tr>
<th scope="row">
# Running?
if (scalar @pids) {
+ # Get memory consumption
+ my $mem = &General::get_memory_consumption(@pids);
+
# Format memory
$mem = &General::formatBytes($mem);