fixed indentation

This commit is contained in:
2022-12-17 20:19:03 +01:00
parent 2a05bc8392
commit a33726fba8
22 changed files with 800 additions and 800 deletions

View File

@@ -13,32 +13,32 @@
get_os_version()
{
if [[ ! -f /etc/os-release ]]; then
prnt E "get_os_version(): Your distribution doesn't have the needed os-release file."
die 8 --force
prnt E "get_os_version(): Your distribution doesn't have the needed os-release file."
die 8 --force
fi
# Create a sub-shell to avoid polluting the environnement
(
# Iniitalise version codename in case the var don't exists
VERSION_CODENAME="NULL"
# Iniitalise version codename in case the var don't exists
VERSION_CODENAME="NULL"
# Import the file in the environment
source /etc/os-release
# Import the file in the environment
source /etc/os-release
if [[ -z $ID ]]; then
prnt E "get_os_version(): Your /etc/os-release file mises some vital information."
die 8 --force
fi
if [[ -z $ID ]]; then
prnt E "get_os_version(): Your /etc/os-release file mises some vital information."
die 8 --force
fi
if [[ -z $VERSION_ID ]]; then
local maj=$(uname -r | cut -d'.' -f1)
local min=$(uname -r | cut -d'.' -f2)
VERSION_ID="$maj.$min"
unset maj min
fi
if [[ -z $VERSION_ID ]]; then
local maj=$(uname -r | cut -d'.' -f1)
local min=$(uname -r | cut -d'.' -f2)
VERSION_ID="$maj.$min"
unset maj min
fi
# Return values on stdout
echo ${ID,,} ${VERSION_ID} ${VERSION_CODENAME,,}
# Return values on stdout
echo ${ID,,} ${VERSION_ID} ${VERSION_CODENAME,,}
)
}
export read_os_release
@@ -50,17 +50,17 @@ export read_os_release
set_sys_vars()
{
if [[ $# -ne 4 ]]; then
prnt E "set_sys_vars(): Incorrect number of parameters ($@)."
die 7 --force
prnt E "set_sys_vars(): Incorrect number of parameters ($@)."
die 7 --force
fi
export SYS_ARCH=$1
export SYS_DIST=$2
export SYS_VER=$3
if [[ $4 != "null" ]]; then
export SYS_CODE=$4
export SYS_CODE=$4
elif [[ -n $SYS_CODE ]]; then
unset SYS_CODE
unset SYS_CODE
fi
}
export -f get_os_version