From 2859cbfc676847db1618718e3229283c1e714c3e Mon Sep 17 00:00:00 2001 From: levasseur Date: Tue, 12 Oct 2021 16:58:20 +0200 Subject: [PATCH] upgrade_dist: fixed proxy, fixed ntp dependency for aptitude --- conf/init.conf.sh | 2 +- modules/upgrade_dist.sh | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/conf/init.conf.sh b/conf/init.conf.sh index 8627516..d33e898 100644 --- a/conf/init.conf.sh +++ b/conf/init.conf.sh @@ -82,6 +82,6 @@ VM_NAME=vm-levasseur # ------------------------------------------------------------------------------ # 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 \ install_profile" diff --git a/modules/upgrade_dist.sh b/modules/upgrade_dist.sh index 91537c1..ad9d5f2 100644 --- a/modules/upgrade_dist.sh +++ b/modules/upgrade_dist.sh @@ -13,10 +13,11 @@ # * 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 -export DEP_upgrade_dist="" +# As aptitude might fail if clock is too far from real time, we need to depend +# on ntp +export DEP_upgrade_dist="conf_ntp" upgrade_dist() { @@ -26,7 +27,7 @@ upgrade_dist() backupdist /etc/apt prnt I "Configuration du proxy pour APT..." - if [[ $PROXYAPT ]]; then + if [[ -n $PROXYAPT ]]; then if [[ ! -d $(dirname $proxyfile) ]]; then mkdir -pv $(dirname $proxyfile) || ( prnt E "Impossiblle de créer le répertoire d'accueil pour la configuration d'APT." @@ -35,6 +36,9 @@ upgrade_dist() fi echo "# Generated automatically on $(stdtime) by $0" > $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 prnt I "Pas de proxy configuré, ne fait rien." fi