Update install.func

Check to see if the apt-cacher-ng proxy is available before attempting to use it. If it's not available, the system will directly communicate with the apt repositories.
pull/2487/head
tteckster 10 months ago committed by GitHub
parent 302368a912
commit ffd2fc3b86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -154,7 +154,16 @@ network_check() {
update_os() { update_os() {
msg_info "Updating Container OS" msg_info "Updating Container OS"
if [[ "$CACHER" == "yes" ]]; then if [[ "$CACHER" == "yes" ]]; then
echo "Acquire::http { Proxy \"http://${CACHER_IP}:3142\"; };" >/etc/apt/apt.conf.d/00aptproxy echo "Acquire::http::Proxy-Auto-Detect \"/usr/local/bin/apt-proxy-detect.sh\";" >/etc/apt/apt.conf.d/00aptproxy
cat <<EOF >/usr/local/bin/apt-proxy-detect.sh
#!/bin/bash
if nc -w1 -z "${CACHER_IP}" 3142; then
echo -n "http://${CACHER_IP}:3142"
else
echo -n "DIRECT"
fi
EOF
chmod +x /usr/local/bin/apt-proxy-detect.sh
fi fi
$STD apt-get update $STD apt-get update
$STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade $STD apt-get -o Dpkg::Options::="--force-confold" -y dist-upgrade

Loading…
Cancel
Save

Powered by BW's shoe-string budget.