From 9225592be002b642c3ab8bb693b141d3028814be Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Fri, 5 May 2023 18:53:57 +0000 Subject: [PATCH] Adding d/p/17_fix_exit_codes from upstream --- debian/patches/17_fix_exit_codes | 166 +++++++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 167 insertions(+) create mode 100644 debian/patches/17_fix_exit_codes diff --git a/debian/patches/17_fix_exit_codes b/debian/patches/17_fix_exit_codes new file mode 100644 index 0000000..5374530 --- /dev/null +++ b/debian/patches/17_fix_exit_codes @@ -0,0 +1,166 @@ +From 5af4db7b4169acee20bfa2d637ce3f3eb5bdef47 Mon Sep 17 00:00:00 2001 +From: MisterMountain +Date: Tue, 11 Apr 2023 16:26:12 +0200 +Subject: [PATCH 1/3] fixed the outputs of the --versions options on 3 scripts + +--- + plugins-scripts/check_log.sh | 2 +- + plugins-scripts/check_oracle.sh | 2 +- + plugins-scripts/check_sensors.sh | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh +index c623a8d6b..10c56f14b 100755 +--- a/plugins-scripts/check_log.sh ++++ b/plugins-scripts/check_log.sh +@@ -109,7 +109,7 @@ while test -n "$1"; do + ;; + -V | --version) + print_revision "$PROGNAME" "$REVISION" +- exit "$STATE_OK" ++ exit "$STATE_UNKNOWN" + ;; + -F | --filename) + logfile=$2 +diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh +index b14ec50ed..f340b97c4 100755 +--- a/plugins-scripts/check_oracle.sh ++++ b/plugins-scripts/check_oracle.sh +@@ -95,7 +95,7 @@ case "$cmd" in + ;; + --version) + print_revision "$PROGNAME" "$REVISION" +- exit "$STATE_OK" ++ exit "$STATE_UNKNOWN" + ;; + -V) + print_revision "$PROGNAME" "$REVISION" +diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh +index 921e7b365..3c4cf01bf 100755 +--- a/plugins-scripts/check_sensors.sh ++++ b/plugins-scripts/check_sensors.sh +@@ -34,7 +34,7 @@ case "$1" in + ;; + --version) + print_revision "$PROGNAME" "$REVISION" +- exit "$STATE_OK" ++ exit "$STATE_UNKNOWN" + ;; + -V) + print_revision "$PROGNAME" "$REVISION" + +From 3dc677e4f1f990e7b26bc714a02608070379cf85 Mon Sep 17 00:00:00 2001 +From: MisterMountain +Date: Tue, 11 Apr 2023 17:11:06 +0200 +Subject: [PATCH 2/3] fixed the identation (and also patched -V on check_oracle + to behave exactly like --version again) + +--- + plugins-scripts/check_oracle.sh | 10 +++++----- + plugins-scripts/check_sensors.sh | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh +index f340b97c4..d58cfbea3 100755 +--- a/plugins-scripts/check_oracle.sh ++++ b/plugins-scripts/check_oracle.sh +@@ -86,20 +86,20 @@ esac + # Information options + case "$cmd" in + --help) +- print_help ++ print_help + exit "$STATE_OK" + ;; + -h) +- print_help ++ print_help + exit "$STATE_OK" + ;; + --version) +- print_revision "$PROGNAME" "$REVISION" ++ print_revision "$PROGNAME" "$REVISION" + exit "$STATE_UNKNOWN" + ;; + -V) +- print_revision "$PROGNAME" "$REVISION" +- exit "$STATE_OK" ++ print_revision "$PROGNAME" "$REVISION" ++ exit "$STATE_UNKNOWN" + ;; + esac + +diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh +index 3c4cf01bf..adbfc533f 100755 +--- a/plugins-scripts/check_sensors.sh ++++ b/plugins-scripts/check_sensors.sh +@@ -38,7 +38,7 @@ case "$1" in + ;; + -V) + print_revision "$PROGNAME" "$REVISION" +- exit "$STATE_OK" ++ exit "$STATE_UNKNOWN" + ;; + *) + sensordata=$(sensors 2>&1) + +From 21885d85d54ce2afe7b9bf962348dc60e31442e0 Mon Sep 17 00:00:00 2001 +From: MisterMountain +Date: Tue, 2 May 2023 09:40:35 +0200 +Subject: [PATCH 3/3] also fixed the --help returns + +--- + plugins-scripts/check_log.sh | 2 +- + plugins-scripts/check_oracle.sh | 4 ++-- + plugins-scripts/check_sensors.sh | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh +index 10c56f14b..8ecdd3164 100755 +--- a/plugins-scripts/check_log.sh ++++ b/plugins-scripts/check_log.sh +@@ -105,7 +105,7 @@ while test -n "$1"; do + case "$1" in + -h | --help) + print_help +- exit "$STATE_OK" ++ exit "$STATE_UNKNOWN" + ;; + -V | --version) + print_revision "$PROGNAME" "$REVISION" +diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh +index d58cfbea3..599813865 100755 +--- a/plugins-scripts/check_oracle.sh ++++ b/plugins-scripts/check_oracle.sh +@@ -87,11 +87,11 @@ esac + case "$cmd" in + --help) + print_help +- exit "$STATE_OK" ++ exit "$STATE_UNKNOWN" + ;; + -h) + print_help +- exit "$STATE_OK" ++ exit "$STATE_UNKNOWN" + ;; + --version) + print_revision "$PROGNAME" "$REVISION" +diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh +index adbfc533f..866e0e0f0 100755 +--- a/plugins-scripts/check_sensors.sh ++++ b/plugins-scripts/check_sensors.sh +@@ -26,11 +26,11 @@ print_help() { + case "$1" in + --help) + print_help +- exit "$STATE_OK" ++ exit "$STATE_UNKNOWN" + ;; + -h) + print_help +- exit "$STATE_OK" ++ exit "$STATE_UNKNOWN" + ;; + --version) + print_revision "$PROGNAME" "$REVISION" diff --git a/debian/patches/series b/debian/patches/series index 4eda460..2d378b8 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -8,6 +8,7 @@ 14_check_curl_fix_SSL_with_multiple_IPs 15_check_swap_remove_includes 16_check_snmp_disable_multiplier_when_unused +17_fix_exit_codes # feature patches 30_check_radius_radcli_1.3.1_support 31_checl_mailq_separate_submission_queue