Merge branch 'master' of ssh://apo.geoffray-levasseur.org/share/services/git/legos

This commit is contained in:
levasseur
2021-10-18 16:40:21 +02:00
11 changed files with 33 additions and 29 deletions

View File

@@ -17,7 +17,7 @@ function die()
# Don't trigger the ERR signal as we already managed the error
trap - ERR
if [[ "$KEEPGOING" != "true" ]] || [[ "$2" == "--force" ]]; then
prnt E "Sortie prématuré avec erreur (code #$errorcode)."
# We remove KEEPGOING in case of --force so error() behave correctly
@@ -27,7 +27,7 @@ function die()
prnt W "On continue malgrés l'erreur #$errorcode."
fi
unset errorcode
# Put the trigger back (only executed with --keepgoing)
trap "error ${LINENO}" ERR
}
@@ -52,10 +52,10 @@ function error()
local parent_lineno="$1"
local message="$2"
local code="${3:-1}"
# Print error header
prnt E "${BIWhite}*** ${BIRed}Une erreur fatale est intervenue, le script va s'arrêter immédiatement !$DEFAULTCOL"
if [[ -n "$message" ]]; then
prnt E "Erreur ligne $parent_lineno, code d'erreur $code avec le message :"
echo -e "\t\t$message"
@@ -87,7 +87,7 @@ function backtrace
{
echo "======== Pile d'appel ========"
typeset -i i=0
local func=
for func in "${FUNCNAME[@]}"; do
if [[ $i -ne 0 ]]; then

View File

@@ -79,7 +79,7 @@ show_version()
echo -e "${BWhite}init.sh${DEFAULTCOL} version ${BGreen}$VERSION${DEFAULTCOL}"
echo ""
echo "Modules disponibles :"
local mod=
for mod in $MYPATH/modules/*.sh; do
# Ran in a subshell to not pollute environment
@@ -94,7 +94,7 @@ show_version()
)
done
unset mod
if [[ $(id -u) -ne 0 ]]; then
echo -e "\n${BYellow}Attention :$DEFAULTCOL Ce script requiert les droits d'administration pour fonctionner."
fi

View File

@@ -53,7 +53,7 @@ set_sys_vars()
prnt E "get_os_version(): incorect number of parameters ($@)."
die --force 7
fi
export SYS_ARCH=$1
export SYS_DIST=$2
export SYS_VER=$3

View File

@@ -19,13 +19,17 @@ read_commandline()
prnt E "Erreur d'analyse de la ligne de commande, vérifiez vos paramètres."
die 1 --force
}
# Processing command line options
local want_module=false
local want_logfile=false
local want_conffile=false
<<<<<<< HEAD
local want_conffile=false
=======
>>>>>>> 4cfa6561d648917e254a858a5d38cf4d4a90267e
local opt=
for opt in $@; do
case $opt in