added set_reboot_needed function and use it

This commit is contained in:
levasseur
2022-01-14 16:37:30 +01:00
parent b722107d1c
commit d85e2a819b
6 changed files with 28 additions and 7 deletions

10
init.sh
View File

@@ -246,13 +246,19 @@ if [[ $key == "C" || $key == 'c' ]]; then
separator
done
unset mod
echo
else
echo -e "${Yellow}The system has not undergone any modification.${DEFAULTCOL}"
echo
fi
prnt I "That's all folks !"
echo
rm -f $STAGEFILE
if [[ $REBOOT_NEEDED==true ]]; then
prnt W "A reboot is required to apply some changes."
prnt i "Please reboot now or as soon as possible !"
echo
fi
exit 0
# EOF

View File

@@ -61,4 +61,16 @@ set_system_proxy()
export -f set_system_proxy
# ------------------------------------------------------------------------------
# Set a reboot nedeed flag to display a warning at the end
set_reboot_needed()
{
if [[ $NEED_REBOOT==true ]]; then
# Reboot flag already set, nothing to do
return 0
else
export NEED_REBOOT=true
fi
}
# EOF

View File

@@ -20,7 +20,7 @@
# * DEFAULT_SHELL: The shell to use when creating new users
# ------------------------------------------------------------------------------
export VER_authnz=0.1.5
export VER_authnz=0.1.6
export DEP_authnz="upgrade_dist"
# Users (from Ldap)
@@ -34,7 +34,7 @@ add_remote_user()
remove_user()
{
# Using sed is more universal than any distro commands
sed -i -e "/^$1/d" /etc/passwd /etc/shadow /etc/group
sed -i -e "/^$1/d" /etc/passwd /etc/shadow /etc/group /etc/gshadow
}
# Create a local user

View File

@@ -20,7 +20,7 @@
# * NET{4,6}_MANUAL_FILE_$iface: filename for manual configuration of $iface
# ------------------------------------------------------------------------------
export VER_conf_syslog="0.0.4"
export VER_conf_syslog="0.0.5"
conf_network()
{
@@ -100,6 +100,7 @@ conf_network()
done
unset iface if_file
set_reboot_needed
}
precheck_conf_network()

View File

@@ -15,7 +15,7 @@
# * X11_DRV: Used to install proprietary driver for X.org (eg: nvidia-drivers)
# ------------------------------------------------------------------------------
export VER_install_desktop="0.0.2"
export VER_install_desktop="0.0.3"
export DEP_install_desktop="upgrade_dist"
install_desktop()
@@ -28,6 +28,7 @@ install_desktop()
prnt I "Installation de l'environnement $UBUNTU_FLAVOR..."
pkginst ${UBUNTU_FLAVOR}-desktop
fi
set_reboot_needed
}
precheck_install_desktop()

View File

@@ -8,7 +8,7 @@
# https://opensource.org/licenses/BSD-3-Clause
# ------------------------------------------------------------------------------
export VER_select_system_proxy="0.0.1"
export VER_select_system_proxy="0.0.2"
export DEP_select_system_proxy="upgrade_dist"
select_system_proxy()
@@ -20,6 +20,7 @@ select_system_proxy()
else
prnt I "Pas de configurtion proxy, rien à faire."
fi
set_reboot_needed
}
precheck_select_system_proxy()