few improvements, consistency fixes

This commit is contained in:
levasseur
2021-10-06 17:55:04 +02:00
parent a1372a5d50
commit ee3a8d91ba
2 changed files with 20 additions and 12 deletions

15
init.sh
View File

@@ -44,9 +44,6 @@ export MYPATH=$(dirname $(realpath -s $0))
# Get hostname
export HOSTNAME=$(hostname)
# System architecture
export SYS_ARCH=$(uname -m)
# Load libraries
for lib in $MYPATH/lib/*.sh; do
. $lib
@@ -69,13 +66,13 @@ function_exists prnt || (
exit 3
)
# Set system dependent vars
get_os_version $(read_os_release)
# ======================
# ==== Main Program ====
# ======================
# Set system dependent vars
set_sys_vars $(uname -m) $(get_os_version)
# Initializing global variables
export CHECK_ONLY=false
export JUMP=false
@@ -109,7 +106,11 @@ exec > >(tee -a $LOGFILE)
exec 2> >(tee -a $LOGFILE >&2)
prnt I "Démarrage d'init version $VERSION."
prnt I "Le fichier de log est $LOGFILE."
prnt I "Lancé sur $SYS_DIST version $SYS_VER ($SYS_CODE) architecture $SYS_ARCH"
if [[ -n $SYS_CODE ]]; then
prnt I "Lancé sur $SYS_DIST version $SYS_VER ($SYS_CODE) architecture $SYS_ARCH"
else
prnt I "Lancé sur $SYS_DIST version $SYS_VER architecture $SYS_ARCH"
fi
# -- Cannot be a function ends here