added proxy cleanup before changing it
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
# * PROXY_SRV_PORT: Working port for general purpose proxy if one declared
|
# * PROXY_SRV_PORT: Working port for general purpose proxy if one declared
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
export VER_upgrade_dist="0.2.3"
|
export VER_upgrade_dist="0.2.4"
|
||||||
|
|
||||||
# As aptitude might fail if clock is too far from real time, we need to depend
|
# As aptitude might fail if clock is too far from real time, we need to depend
|
||||||
# on ntp
|
# on ntp
|
||||||
@@ -43,6 +43,14 @@ upgrade_dist()
|
|||||||
prnt E "Impossible to create directory to receive APT configuration."
|
prnt E "Impossible to create directory to receive APT configuration."
|
||||||
die 60
|
die 60
|
||||||
)
|
)
|
||||||
|
else
|
||||||
|
# Cleanup
|
||||||
|
if [[ -s $proxyfile ]]; then
|
||||||
|
emptyflie $proxyfile
|
||||||
|
fi
|
||||||
|
if [[ $(grep "^Acquire::http::Proxy" /etc/apt/apt.conf) ]]; then
|
||||||
|
sed -i -e "/^Acquire::http::Proxy/d" /etc/apt/apt.conf
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
tag_file $proxyfile
|
tag_file $proxyfile
|
||||||
echo "Acquire::http::Proxy \"http://${PROXY_APT}:${PROXY_APT_PORT}\";" >> $proxyfile
|
echo "Acquire::http::Proxy \"http://${PROXY_APT}:${PROXY_APT_PORT}\";" >> $proxyfile
|
||||||
|
|||||||
Reference in New Issue
Block a user