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

add params for help and cutom install directory

parent 15fd0f1e
No related branches found
No related tags found
1 merge request!124Update docs
......@@ -16,16 +16,60 @@
# 2022-08-10 v1.9 <axel.hahn@iml.unibe.ch> FIX: mask the dot in .log
# 2022-10-21 v1.10 <axel.hahn@unibe.ch> remove grep: warning: stray \ before white space
# show last backup, prune, verify
# 2023-06-22 v1.11 <axel.hahn@unibe.ch> add help and param support; add parameter for install directory
# ======================================================================
. $( dirname $0 )/inc_pluginfunctions
self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] )
self_APPVERSION=1.11
sInstalldir=/opt/imlbackup/client/
sChecker=$sInstalldir/check_clientbackup.sh
# ----------------------------------------------------------------------
# FUNCTIONS
# ----------------------------------------------------------------------
function showHelp(){
_self=$(basename $0)
cat <<EOF
______________________________________________________________________
$self_APPNAME
v$self_APPVERSION
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
______________________________________________________________________
Show status of IML backup.
SYNTAX:
$_self [-d DIRECTORY]
OPTIONS:
-h or --help show this help.
-d or --dir set installation dir of iml backup to find its check skript
default: /opt/imlbackup/client/
EXAMPLE:
$_self -d /home/backup/imlbackup
set a custom directory und run the backup check
EOF
}
# --- check param -h
while [[ "$#" -gt 0 ]]; do case $1 in
-h|--help) showHelp; exit 0;;
-d|--dir) sInstalldir=$2; shift ;shift;;
*) echo "ERROR: Unknown parameter: $1"; showHelp; exit 1;
esac; done
sChecker=$sInstalldir/check_clientbackup.sh
if [ ! -x $sChecker ]; then
ph.abort "$sChecker not found - maybe clientbackup is not installed."
ph.abort "$sChecker not found - maybe clientbackup is not installed here. Use param -d to set the install directory."
fi
result=$( $sChecker )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment