diff --git a/PVE/Storage/CIFSPlugin.pm b/PVE/Storage/CIFSPlugin.pm index 6edbc9d..7ec7164 100644 --- a/PVE/Storage/CIFSPlugin.pm +++ b/PVE/Storage/CIFSPlugin.pm @@ -262,14 +262,12 @@ sub check_connection { } else { push @$cmd, '-U', 'Guest','-N'; } - push @$cmd, '-c', 'echo 1 0'; my $out_str; - eval { - run_command($cmd, timeout => 2, outfunc => sub {$out_str .= shift;}, - errfunc => sub {}); - }; + my $out = sub { $out_str .= shift }; + + eval { run_command($cmd, timeout => 10, outfunc => $out, errfunc => sub {}) }; if (my $err = $@) { die "$out_str\n" if defined($out_str) && diff --git a/PVE/Storage/NFSPlugin.pm b/PVE/Storage/NFSPlugin.pm index 6abb24b..c94fb91 100644 --- a/PVE/Storage/NFSPlugin.pm +++ b/PVE/Storage/NFSPlugin.pm @@ -166,9 +166,7 @@ sub check_connection { my $cmd = ['/sbin/showmount', '--no-headers', '--exports', $server]; - eval { - run_command($cmd, timeout => 2, outfunc => sub {}, errfunc => sub {}); - }; + eval { run_command($cmd, timeout => 10, outfunc => sub {}, errfunc => sub {}) }; if (my $err = $@) { return 0; }