add simple bin script to show version…

This commit is contained in:
Jérémy Lecour 2023-12-29 15:17:39 +01:00 committed by Jérémy Lecour
parent 4b71218ae1
commit ceb12254be
Signed by: jlecour
SSH key fingerprint: SHA256:h+5LgHRKwN9lS0SsdVR5yZPeFlJE4Mt+8UtL4CcP8dY
2 changed files with 50 additions and 0 deletions

31
client/bin/evobackup Normal file
View file

@ -0,0 +1,31 @@
#!/bin/sh
# Change this to wherever you install the libraries
LIBDIR="/usr/local/lib/evobackup"
source "${LIBDIR}/main.sh"
# Parse options, based on https://gist.github.com/deshion/10d3cb5f88a21671e17a
while :; do
case ${1:-''} in
-V|--version)
show_version
exit 0
;;
--)
# End of all options.
shift
break
;;
-?*|[[:alnum:]]*)
# ignore unknown options
log_error "unknown option '${1}' (ignored)"
;;
*)
# Default case: If no more options then break out of the loop.
break
;;
esac
shift
done

View file

@ -18,6 +18,25 @@ source "${LIBDIR}/dump-mysql.sh"
source "${LIBDIR}/dump-postgresql.sh"
source "${LIBDIR}/dump-misc.sh"
show_version() {
cat <<END
evobackup version ${VERSION}
Copyright 2023 Evolix <info@evolix.fr>,
Gregory Colpart <reg@evolix.fr>,
Romain Dessort <rdessort@evolix.fr>,
Benoit Série <bserie@evolix.fr>,
Tristan Pilat <tpilat@evolix.fr>,
Victor Laborie <vlaborie@evolix.fr>,
Jérémy Lecour <jlecour@evolix.fr>
and others.
evobackup comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
See the GNU General Public License v3.0 for details.
END
}
# Called from main, it is wrapping the local_tasks function defined in the real script
local_tasks_wrapper() {
log "START LOCAL_TASKS"