code cleanup: force local var before calling a for loop, make sure it's unset when no longer needed
This commit is contained in:
@@ -76,12 +76,19 @@ 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
|
||||
. $mod
|
||||
local modname=$(get_mod_name $mod)
|
||||
local version=VER_$modname
|
||||
|
||||
echo -e "\t$BWhite$modname${DEFAULTCOL}: $BGreen${!version}$DEFAULTCOL"
|
||||
|
||||
unset modname 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
|
||||
@@ -98,4 +105,3 @@ get_mod_name()
|
||||
export -f get_mod_name
|
||||
|
||||
# EOF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user