mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
get the version from rtorrent out of the loop and cache it already to avoid SOCK to be overwritten
This commit is contained in:
parent
54ad1ad4d5
commit
9534979768
2 changed files with 10 additions and 3 deletions
|
@ -104,9 +104,12 @@ sub rtorrent_version_lower_than {
|
|||
}
|
||||
close (SOCK);
|
||||
}
|
||||
return version->parse($rtorrent_version) < version->parse($_[0]);
|
||||
if(defined $_[0]){
|
||||
return version->parse($rtorrent_version) < version->parse($_[0]);
|
||||
}
|
||||
}
|
||||
|
||||
# init rtorrent_version
|
||||
rtorrent_version_lower_than();
|
||||
|
||||
my $pattern = qr/<value><string>([A-Z0-9]+)<\/string><\/value>/;
|
||||
|
||||
|
|
|
@ -106,8 +106,12 @@ sub rtorrent_version_lower_than {
|
|||
}
|
||||
close (SOCK);
|
||||
}
|
||||
return version->parse($rtorrent_version) < version->parse($_[0]);
|
||||
if(defined $_[0]){
|
||||
return version->parse($rtorrent_version) < version->parse($_[0]);
|
||||
}
|
||||
}
|
||||
# init rtorrent_version
|
||||
rtorrent_version_lower_than();
|
||||
|
||||
my $pattern = qr/<value><string>([A-Z0-9]+)<\/string><\/value>/;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue