upgrade_dist: fixed proxy, fixed ntp dependency for aptitude

This commit is contained in:
levasseur
2021-10-12 16:58:20 +02:00
parent 65f39c6545
commit 2859cbfc67
2 changed files with 9 additions and 5 deletions

View File

@@ -82,6 +82,6 @@ VM_NAME=vm-levasseur
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Liste des modules à executer (surchargeable en ligne de commande) # Liste des modules à executer (surchargeable en ligne de commande)
MODULE_LIST="upgrade_dist authnz conf_disks conf_locale conf_ntp conf_ssh \ MODULE_LIST="conf_ntp upgrade_dist authnz conf_disks conf_locale conf_ssh \
conf_mail install_desktop install_pkg install_chromium \ conf_mail install_desktop install_pkg install_chromium \
install_profile" install_profile"

View File

@@ -13,10 +13,11 @@
# * PROXYAPTPORT: Working port for APT proxy # * PROXYAPTPORT: Working port for APT proxy
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
export VER_upgrade_dist="0.0.11" export VER_upgrade_dist="0.1.1"
# The following var must stay empty # As aptitude might fail if clock is too far from real time, we need to depend
export DEP_upgrade_dist="" # on ntp
export DEP_upgrade_dist="conf_ntp"
upgrade_dist() upgrade_dist()
{ {
@@ -26,7 +27,7 @@ upgrade_dist()
backupdist /etc/apt backupdist /etc/apt
prnt I "Configuration du proxy pour APT..." prnt I "Configuration du proxy pour APT..."
if [[ $PROXYAPT ]]; then if [[ -n $PROXYAPT ]]; then
if [[ ! -d $(dirname $proxyfile) ]]; then if [[ ! -d $(dirname $proxyfile) ]]; then
mkdir -pv $(dirname $proxyfile) || ( mkdir -pv $(dirname $proxyfile) || (
prnt E "Impossiblle de créer le répertoire d'accueil pour la configuration d'APT." prnt E "Impossiblle de créer le répertoire d'accueil pour la configuration d'APT."
@@ -35,6 +36,9 @@ upgrade_dist()
fi fi
echo "# Generated automatically on $(stdtime) by $0" > $proxyfile echo "# Generated automatically on $(stdtime) by $0" > $proxyfile
echo "Acquire::http::Proxy \"http://${PROXYAPT}:${PROXYAPTPORT}\";" >> $proxyfile echo "Acquire::http::Proxy \"http://${PROXYAPT}:${PROXYAPTPORT}\";" >> $proxyfile
elif [[ -n $http_proxy ]]; then
echo "# Generated automatically on $(stdtime) by $0" > $proxyfile
echo "Acquire::http::Proxy \"http://${http_proxy}\";" >> $proxyfile
else else
prnt I "Pas de proxy configuré, ne fait rien." prnt I "Pas de proxy configuré, ne fait rien."
fi fi