fix typo, minor optimisation, identation fix
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.4"
|
export VER_upgrade_dist="0.2.5"
|
||||||
|
|
||||||
# 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
|
||||||
@@ -38,27 +38,27 @@ upgrade_dist()
|
|||||||
|
|
||||||
prnt I "Configuring proxy for APT..."
|
prnt I "Configuring proxy for APT..."
|
||||||
if [[ -n $PROXY_APT ]]; then
|
if [[ -n $PROXY_APT ]]; then
|
||||||
if [[ ! -d $(dirname $proxyfile) ]]; then
|
if [[ ! -d $(dirname $proxyfile) ]]; then
|
||||||
mkdir -pv $(dirname $proxyfile) || (
|
mkdir -pv "$(dirname $proxyfile)" || (
|
||||||
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
|
else
|
||||||
# Cleanup
|
# Cleanup
|
||||||
if [[ -s $proxyfile ]]; then
|
if [[ -s $proxyfile ]]; then
|
||||||
emptyflie $proxyfile
|
emptyfile $proxyfile
|
||||||
fi
|
fi
|
||||||
if [[ $(grep "^Acquire::http::Proxy" /etc/apt/apt.conf) ]]; then
|
if grep -q "^Acquire::http::Proxy" /etc/apt/apt.conf; then
|
||||||
sed -i -e "/^Acquire::http::Proxy/d" /etc/apt/apt.conf
|
sed -i -e "/^Acquire::http::Proxy/d" /etc/apt/apt.conf
|
||||||
fi
|
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
|
||||||
elif [[ -n $PROXY_SRV ]]; then
|
elif [[ -n $PROXY_SRV ]]; then
|
||||||
tag_file $proxyfile
|
tag_file $proxyfile
|
||||||
echo "Acquire::http::Proxy \"http://${PROXY_SRV}:${PROXY_SRV_PORT}\";" >> $proxyfile
|
echo "Acquire::http::Proxy \"http://${PROXY_SRV}:${PROXY_SRV_PORT}\";" >> $proxyfile
|
||||||
else
|
else
|
||||||
prnt I "No proxy configured, nothing to do."
|
prnt I "No proxy configured, nothing to do."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remplace source.list from dist with ours (be smarter)
|
# Remplace source.list from dist with ours (be smarter)
|
||||||
@@ -79,16 +79,16 @@ precheck_upgrade_dist()
|
|||||||
prnt I "Checking network connectivity..."
|
prnt I "Checking network connectivity..."
|
||||||
|
|
||||||
if [[ $(noerror wget -q --tries=10 --timeout=20 --spider http://www.tetaneutral.net) != 0 ]]; then
|
if [[ $(noerror wget -q --tries=10 --timeout=20 --spider http://www.tetaneutral.net) != 0 ]]; then
|
||||||
prnt E "It seems network configuration is not functionnal! Giving up."
|
prnt E "It seems network configuration is not functionnal! Giving up."
|
||||||
die 160
|
die 160
|
||||||
fi
|
fi
|
||||||
if [[ -n $PROXY_APT && -z $PROXY_APT_PORT ]]; then
|
if [[ -n $PROXY_APT && -z $PROXY_APT_PORT ]]; then
|
||||||
prnt E "An APT proxy server have been specified but not its working port."
|
prnt E "An APT proxy server have been specified but not its working port."
|
||||||
die 160
|
die 160
|
||||||
fi
|
fi
|
||||||
if [[ -n $PROXY_SRV && -z $PROXY_SRV_PORT ]]; then
|
if [[ -n $PROXY_SRV && -z $PROXY_SRV_PORT ]]; then
|
||||||
prnt E "A general proxy server have been specified but not its working port."
|
prnt E "A general proxy server have been specified but not its working port."
|
||||||
die 160
|
die 160
|
||||||
fi
|
fi
|
||||||
file_must_exists pkgman/${SYS_DIST}_${SYS_VER}.list
|
file_must_exists pkgman/${SYS_DIST}_${SYS_VER}.list
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user