Don't set yum/apt proxy if updating through manager

This commit is contained in:
William Wernert
2021-04-21 15:59:37 -04:00
parent d5717b7011
commit f3d663f090

View File

@@ -2410,13 +2410,15 @@ set_proxy() {
"}" > /root/.docker/config.json "}" > /root/.docker/config.json
# Set proxy for package manager # Set proxy for package manager
if [ "$OS" = 'centos' ]; then if [[ $MANAGERUPDATES != 1 ]]; then
echo "proxy=$so_proxy" >> /etc/yum.conf if [ "$OS" = 'centos' ]; then
else echo "proxy=$so_proxy" >> /etc/yum.conf
# Set it up so the updates roll through the manager else
printf '%s\n'\ # Set it up so the updates roll through the manager
"Acquire::http::Proxy \"$so_proxy\";"\ printf '%s\n'\
"Acquire::https::Proxy \"$so_proxy\";" > /etc/apt/apt.conf.d/00-proxy.conf "Acquire::http::Proxy \"$so_proxy\";"\
"Acquire::https::Proxy \"$so_proxy\";" > /etc/apt/apt.conf.d/00-proxy.conf
fi
fi fi
# Set global git proxy # Set global git proxy
@@ -2684,10 +2686,8 @@ set_redirect() {
set_updates() { set_updates() {
if [ "$MANAGERUPDATES" = '1' ]; then if [ "$MANAGERUPDATES" = '1' ]; then
if [ "$OS" = 'centos' ]; then if [ "$OS" = 'centos' ]; then
if [[ ! $is_airgap ]]; then if [[ ! $is_airgap ]] && ! ( grep -q "$MSRV" /etc/yum.conf); then
if ! grep -q "$MSRV" /etc/yum.conf; then echo "proxy=http://$MSRV:3142" >> /etc/yum.conf
echo "proxy=http://$MSRV:3142" >> /etc/yum.conf
fi
fi fi
else else
# Set it up so the updates roll through the manager # Set it up so the updates roll through the manager