diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-08-18 18:03:10 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-08-18 18:03:10 +0000 |
commit | 318bb4ae140f0676f1988815d99dcf707a51337c (patch) | |
tree | c5a8cd3ce03b1256db47f0481e83a612cdebf042 | |
parent | 9be0af942ae5d23cebbb92a93b49d8c05f4ff429 (diff) | |
download | monitoring-plugins-318bb4ae140f0676f1988815d99dcf707a51337c.tar.gz |
typo in options passed to ssh for ipv6.
fix by setting a generic hook for 1-char pasthhru options
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@81 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | plugins/check_by_ssh.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c index 5aee5343..59264dcd 100644 --- a/plugins/check_by_ssh.c +++ b/plugins/check_by_ssh.c @@ -257,10 +257,10 @@ call_getopt (int argc, char **argv) while (1) { #ifdef HAVE_GETOPT_H c = - getopt_long (argc, argv, "+?Vvhft46:H:O:p:i:u:l:C:n:s:", long_options, + getopt_long (argc, argv, "+?Vvhft46H:O:p:i:u:l:C:n:s:", long_options, &option_index); #else - c = getopt (argc, argv, "+?Vvhft46:H:O:p:i:u:l:C:n:s:"); + c = getopt (argc, argv, "+?Vvhft46H:O:p:i:u:l:C:n:s:"); #endif if (c == -1 || c == EOF) @@ -293,9 +293,6 @@ call_getopt (int argc, char **argv) case 'v': /* help */ verbose = TRUE; break; - case 'f': /* fork to background */ - comm = ssprintf (comm, "%s -f", comm); - break; case 't': /* timeout period */ if (!is_integer (optarg)) usage2 ("timeout interval must be an integer", optarg); @@ -327,11 +324,10 @@ call_getopt (int argc, char **argv) case 'i': /* identity */ comm = ssprintf (comm, "%s -%c %s", comm, c, optarg); break; - case '4': /* IPv4 */ - comm = ssprintf (comm, "%s -4", comm); - break; - case '6': /* IPv6 */ - comm = ssprintf (comm, "%s -4", comm); + case '4': /* Pass these switches directly to ssh */ + case '6': /* -4 for IPv4, -6 for IPv6 */ + case 'f': /* fork to background */ + comm = ssprintf (comm, "%s -%c", comm, c); break; case 'C': /* Command for remote machine */ commands++; |