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