summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping/probes/Curl.pm
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2007-05-28 17:23:51 +0200
committerTobi Oetiker <tobi@oetiker.ch>2007-05-28 17:23:51 +0200
commit72804714f5a4a15706215c0ea3f0b4a288b3428f (patch)
treef3f5308e67ce21bd8e1f0362415d3929a0122f9e /lib/Smokeping/probes/Curl.pm
parentd13567a129969c4c3ca0548d08a0d34473aca66d (diff)
downloadsmokeping-72804714f5a4a15706215c0ea3f0b4a288b3428f.tar.gz
smokeping-72804714f5a4a15706215c0ea3f0b4a288b3428f.tar.xz
do not test echoping and curl functionality with 127.0.0.1 since there may be someone behind this address
Diffstat (limited to 'lib/Smokeping/probes/Curl.pm')
-rw-r--r--lib/Smokeping/probes/Curl.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Smokeping/probes/Curl.pm b/lib/Smokeping/probes/Curl.pm
index 5f237ab..ee8541b 100644
--- a/lib/Smokeping/probes/Curl.pm
+++ b/lib/Smokeping/probes/Curl.pm
@@ -204,13 +204,14 @@ sub test_usage {
my %arghash = %$arghashref;
for my $feature (keys %arghash) {
- if (`$bin $arghash{$feature} 1 127.0.0.1 2>&1` =~ /invalid option|usage/i) {
+ system("$bin $arghash{$feature} 1 0.0.0.1 >/dev/null 2>&1");
+ if ($? == 2) {
push @unsupported, $feature;
$self->do_log("Note: your curl doesn't support the $feature feature (option $arghash{$feature}), disabling it");
}
}
map { delete $arghashref->{$_} } @unsupported;
- if (`$bin -o /dev/null -w '<%{time_redirect}>\n' 127.0.0.1 2>&1` =~ /^<>/m) {
+ if (`$bin -o /dev/null -w '<%{time_redirect}>\n' 0.0.0.1 2>&1` =~ /^<>/m) {
$self->do_log("Note: your curl doesn't support the 'time_redirect' output variable; 'include_redirects' will not function.");
}
return;