Skip to content
Snippets Groups Projects
Commit 2d6c039e authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update _self in help

parent b262d95a
Branches
No related tags found
1 merge request!1286468 docs and harmonize
...@@ -41,7 +41,7 @@ paramsWget="-T 5 -t 1 --no-check-certificate" ...@@ -41,7 +41,7 @@ paramsWget="-T 5 -t 1 --no-check-certificate"
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
function showHelp(){ function showHelp(){
local _self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
$( ph.showImlHelpHeader ) $( ph.showImlHelpHeader )
......
...@@ -31,7 +31,7 @@ typeset -i iCritical=0 ...@@ -31,7 +31,7 @@ typeset -i iCritical=0
self_APPVERSION=1.5 self_APPVERSION=1.5
function showHelp(){ function showHelp(){
local _self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
$( ph.showImlHelpHeader ) $( ph.showImlHelpHeader )
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
self_APPVERSION=1.4 self_APPVERSION=1.4
function showHelp(){ function showHelp(){
local _self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
$( ph.showImlHelpHeader ) $( ph.showImlHelpHeader )
......
...@@ -41,7 +41,7 @@ iColUpDown=5 ...@@ -41,7 +41,7 @@ iColUpDown=5
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
function showHelp(){ function showHelp(){
local _self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
$( ph.showImlHelpHeader ) $( ph.showImlHelpHeader )
......
...@@ -43,7 +43,7 @@ line="__________________________________________________________________________ ...@@ -43,7 +43,7 @@ line="__________________________________________________________________________
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
function showHelp(){ function showHelp(){
_self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
______________________________________________________________________ ______________________________________________________________________
......
...@@ -31,7 +31,7 @@ sInstalldir=/opt/imlbackup/client/ ...@@ -31,7 +31,7 @@ sInstalldir=/opt/imlbackup/client/
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
function showHelp(){ function showHelp(){
local _self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
$( ph.showImlHelpHeader ) $( ph.showImlHelpHeader )
......
...@@ -35,7 +35,7 @@ self_APPVERSION=1.14 ...@@ -35,7 +35,7 @@ self_APPVERSION=1.14
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
function showHelp(){ function showHelp(){
local _self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
$( ph.showImlHelpHeader ) $( ph.showImlHelpHeader )
......
...@@ -37,7 +37,7 @@ statusScript=/opt/cronwrapper/cronstatus.sh ...@@ -37,7 +37,7 @@ statusScript=/opt/cronwrapper/cronstatus.sh
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
function showHelp(){ function showHelp(){
local _self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
$( ph.showImlHelpHeader ) $( ph.showImlHelpHeader )
......
...@@ -45,7 +45,7 @@ function getDisks(){ ...@@ -45,7 +45,7 @@ function getDisks(){
# show help # show help
function showHelp(){ function showHelp(){
local _self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
$( ph.showImlHelpHeader ) $( ph.showImlHelpHeader )
......
...@@ -37,7 +37,7 @@ typeset -i iNotReachable=0 ...@@ -37,7 +37,7 @@ typeset -i iNotReachable=0
# show help # show help
function showHelp(){ function showHelp(){
local _self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
$( ph.showImlHelpHeader ) $( ph.showImlHelpHeader )
......
...@@ -43,18 +43,19 @@ ...@@ -43,18 +43,19 @@
# #
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# 2020-02-21 v1.0 <axel.hahn@iml.unibe.ch> # 2020-02-21 v1.0 <axel.hahn@iml.unibe.ch>
# 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions # 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions
# 2021-03-26 v1.2 <axel.hahn@iml.unibe.ch> test major version if minor version was not detected # 2021-03-26 v1.2 <axel.hahn@iml.unibe.ch> test major version if minor version was not detected
# 2021-11-02 v1.3 <axel.hahn@iml.unibe.ch> detect centos stream # 2021-11-02 v1.3 <axel.hahn@iml.unibe.ch> detect centos stream
# 2022-02-28 v1.4 <axel.hahn@iml.unibe.ch> remove negative performance data # 2022-02-28 v1.4 <axel.hahn@iml.unibe.ch> remove negative performance data
# 2022-08-29 v1.5 <axel.hahn@iml.unibe.ch> fix help; shell syntax updates # 2022-08-29 v1.5 <axel.hahn@iml.unibe.ch> fix help; shell syntax updates
# 2023-01-30 v1.6 <axel.hahn@unibe.ch> add max value in performance data # 2023-01-30 v1.6 <axel.hahn@unibe.ch> add max value in performance data
# 2023-07-27 v1.7 <axel.hahn@unibe.ch> update help page
# ====================================================================== # ======================================================================
. "$( dirname $0 )/inc_pluginfunctions" . "$( dirname $0 )/inc_pluginfunctions"
eolcfg="${0}-data/*.cfg" eolcfg="${0}-data/*.cfg"
_version="1.5" self_APPVERSION=1.7
# --- limits # --- limits
typeset -i iDaysWarn=365 typeset -i iDaysWarn=365
...@@ -110,8 +111,8 @@ function getDaysLeft(){ ...@@ -110,8 +111,8 @@ function getDaysLeft(){
local mydate=$1 local mydate=$1
echo $mydate | grep "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" >/dev/null echo $mydate | grep "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" >/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
typeset -i local tsend=$(date --date="$mydate" +%s) typeset -i tsend; tsend=$(date --date="$mydate" +%s)
typeset -i local daysLeft=($tsend - $(date +%s))/60/60/24 typeset -i daysLeft; daysLeft=($tsend - $(date +%s))/60/60/24
echo $daysLeft echo $daysLeft
fi fi
} }
...@@ -138,22 +139,10 @@ function findEolDate(){ ...@@ -138,22 +139,10 @@ function findEolDate(){
} }
# ---------------------------------------------------------------------- function showHelp(){
# MAIN local _self; _self=$(basename $0)
# ---------------------------------------------------------------------- cat <<EOF
$( ph.showImlHelpHeader )
# --- no param? show help
if [ $# -lt 2 ]; then
_self=$( basename $0 )
cat <<EOH
______________________________________________________________________
CHECK EOL :: v${_version}
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
______________________________________________________________________
Check and of support of an OS or a product. Check and of support of an OS or a product.
The dates are defined in the files check_eol-*.cfg The dates are defined in the files check_eol-*.cfg
...@@ -183,8 +172,27 @@ EXAMPLES ...@@ -183,8 +172,27 @@ EXAMPLES
$_self os detect $_self os detect
$_self php detect $_self php detect
EOH EOF
}
# ----------------------------------------------------------------------
# MAIN
# ----------------------------------------------------------------------
# --- no param? show help
# --- check param -h
case "$1" in
"--help"|"-h")
showHelp
exit 0
;;
*)
esac
if [ $# -lt 2 ]; then
echo "ERROR: Not enough parameters."
showHelp
ph.abort ph.abort
fi fi
......
...@@ -24,7 +24,7 @@ self_APPVERSION=1.2 ...@@ -24,7 +24,7 @@ self_APPVERSION=1.2
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
function showHelp(){ function showHelp(){
local _self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
$( ph.showImlHelpHeader ) $( ph.showImlHelpHeader )
......
...@@ -24,7 +24,7 @@ out="" ...@@ -24,7 +24,7 @@ out=""
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
function showHelp(){ function showHelp(){
_self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
$( ph.showImlHelpHeader ) $( ph.showImlHelpHeader )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment