diff --git a/check_mysqlserver b/check_mysqlserver index a4217bbdd3f65c206f9a8613e9a46c0dd6c92c9b..c77e64661c6fe1d516ddf7ecfb96b3e193ca5db9 100755 --- a/check_mysqlserver +++ b/check_mysqlserver @@ -19,13 +19,12 @@ # 2021-06-08 v0.1 <axel.hahn@iml.unibe.ch> update HOME .. better implement a param and ENV var # 2021-06-24 v0.2 <axel.hahn@iml.unibe.ch> check if query cache is enabled as a shared function # 2023-06-06 v0.3 <axel.hahn@unibe.ch> some shell fixes +# 2023-07-28 v1.0 <axel.hahn@unibe.ch> update help page; fix [client]: command not found # ====================================================================== - . $( dirname $0 )/inc_pluginfunctions -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=0.3 +export self_APPVERSION=1.0 # --- set HOME HOME=/etc/icingaclient @@ -100,17 +99,11 @@ EOF fi } -# show usage -function _usage(){ - local _self=$( basename $0 ) - cat <<EOH -______________________________________________________________________ - -${self_APPNAME} :: v${self_APPVERSION} - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ +# show help text +function showHelp(){ + local _self; _self=$(basename $0) +cat <<EOF +$( ph.showImlHelpHeader ) USAGE: $_self [OPTIONS] -m METHOD @@ -133,7 +126,7 @@ EXAMPLES: $_self -i $_self -m commands -EOH +EOF } function _mysqlreadvars(){ @@ -206,7 +199,7 @@ bOptUninstall=$( ph.hasParamoption "u" "$@") bOptHelp=$( ph.hasParamoption "h" "$@") if [ $bOptHelp -eq 1 -o $# -lt 1 ]; then - _usage + showHelp exit 0 fi @@ -245,7 +238,6 @@ fi if ! grep $myuser $cfgfile >/dev/null 2>&1; then ph.abort "MYSQL access not possible yet. You need to install the monitoring user first: as root execute $(basename $0) -i" fi -. "${cfgfile}" # ---------------------------------------------------------------------- @@ -328,7 +320,7 @@ case "${sMode}" in *) echo ERRROR: [${sMode}] is an INVALID mode - _usage + showHelp ph.abort esac