Eliminate repeated sudo password prompts during installation

This commit is contained in:
Perdixky
2025-12-03 10:17:42 +08:00
parent c093265b05
commit 8a9f105e75
2 changed files with 60 additions and 0 deletions
+10
View File
@@ -8,6 +8,10 @@ source ./sdata/lib/package-installers.sh
source ./sdata/lib/dist-determine.sh
prevent_sudo_or_root
# Trap to ensure sudo keepalive is stopped on exit
trap sudo_stop_keepalive EXIT INT TERM
set -e
#####################################################################################
@@ -71,6 +75,8 @@ case ${SUBCMD_NAME} in
$function
done
pause
# Initialize sudo keepalive for the entire install process
sudo_init_keepalive
if [[ "${SKIP_ALLGREETING}" != true ]]; then
source ${SUBCMD_DIR}/0.greeting.sh
fi
@@ -89,6 +95,8 @@ case ${SUBCMD_NAME} in
$function
done
pause
# Initialize sudo keepalive for dependency installation
sudo_init_keepalive
if [[ "${SKIP_ALLDEPS}" != true ]]; then
source ${SUBCMD_DIR}/1.deps-router.sh
fi
@@ -98,6 +106,8 @@ case ${SUBCMD_NAME} in
$function
done
pause
# Initialize sudo keepalive for setup steps
sudo_init_keepalive
if [[ "${SKIP_ALLSETUPS}" != true ]]; then
source ${SUBCMD_DIR}/2.setups.sh
fi