Web-add.sh: Add a version number (+ command to fetch it)

This commit is contained in:
Ludovic Poujol 2022-07-07 11:57:03 +02:00
parent 67d0c45d79
commit f65dd98bb1

View file

@ -14,6 +14,7 @@
set -e
VERSION="22.07"
HOME="/root"
CONTACT_MAIL="jdoe@example.org"
WWWBOUNCE_MAIL="jdoe@example.org"
@ -58,6 +59,7 @@ config_file="/etc/evolinux/web-add.conf"
usage() {
cat <<EOT >&2
Evoadmin web tooling - Version $VERSION
Usage: $0 COMMAND [ARG]
add [ [OPTIONS] LOGIN WWWDOMAIN ]
@ -171,6 +173,10 @@ generate-ssl-certificate LOGIN [false]
Generate the Let's Encrypt certificate
Run in TEST mode unless "false" is used
version
Obtain the script version
EOT
}
@ -914,6 +920,9 @@ arg_processing() {
generate-ssl-certificate)
op_generatesslcertificate "$@"
;;
version)
op_version "$@"
;;
*)
usage
;;
@ -1402,5 +1411,10 @@ op_checkvhosts() {
done
}
# Return web-add.sh version
op_version(){
echo "$VERSION"
}
# Point d'entrée
arg_processing "$@"