removed trailing and unneeded space and tabs
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -76,7 +76,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
|
||||
@@ -91,7 +91,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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -19,12 +19,12 @@ 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
|
||||
|
||||
|
||||
local opt=
|
||||
for opt in $@; do
|
||||
case $opt in
|
||||
|
||||
Reference in New Issue
Block a user