Module: monitoring-plugins Branch: master Commit: be4618bf6429bddbd9208a88f460c028074fe8c0 Author: Lorenz Kästle <12514511+rincewinds...@users.noreply.github.com> Date: Thu Mar 13 11:37:52 2025 +0100 URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=be4618bf
check_tcp: patch backwards compatibility in again --- plugins/check_tcp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index 833cdc0c..d2ebc16d 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c @@ -493,6 +493,17 @@ static check_tcp_config_wrapper process_arguments(int argc, char **argv, check_t usage4(_("No arguments found")); } + /* backwards compatibility */ + for (int i = 1; i < argc; i++) { + if (strcmp("-to", argv[i]) == 0) { + strcpy(argv[i], "-t"); + } else if (strcmp("-wt", argv[i]) == 0) { + strcpy(argv[i], "-w"); + } else if (strcmp("-ct", argv[i]) == 0) { + strcpy(argv[i], "-c"); + } + } + if (!is_option(argv[1])) { config.server_address = argv[1]; argv[1] = argv[0];