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

@@ -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