From c1ae7ff3b65376a27289134e1ba04e9b7d00f290 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Wed, 21 Apr 2021 16:18:20 -0400 Subject: [PATCH] Set proxy, replace when setting up yum for manager proxy --- setup/so-functions | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index f8c78238d..86ef60203 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -2410,15 +2410,13 @@ set_proxy() { "}" > /root/.docker/config.json # Set proxy for package manager - if [[ $MANAGERUPDATES != 1 ]]; then - if [ "$OS" = 'centos' ]; then - echo "proxy=$so_proxy" >> /etc/yum.conf - else - # Set it up so the updates roll through the manager - printf '%s\n'\ - "Acquire::http::Proxy \"$so_proxy\";"\ - "Acquire::https::Proxy \"$so_proxy\";" > /etc/apt/apt.conf.d/00-proxy.conf - fi + if [ "$OS" = 'centos' ]; then + echo "proxy=$so_proxy" >> /etc/yum.conf + else + # Set it up so the updates roll through the manager + printf '%s\n'\ + "Acquire::http::Proxy \"$so_proxy\";"\ + "Acquire::https::Proxy \"$so_proxy\";" > /etc/apt/apt.conf.d/00-proxy.conf fi # Set global git proxy @@ -2687,7 +2685,11 @@ set_updates() { if [ "$MANAGERUPDATES" = '1' ]; then if [ "$OS" = 'centos' ]; then if [[ ! $is_airgap ]] && ! ( grep -q "$MSRV" /etc/yum.conf); then - echo "proxy=http://$MSRV:3142" >> /etc/yum.conf + if grep -q "proxy="; then + sed -i "s/proxy=.*/proxy=http:\/\/$MSRV:3142/" + else + echo "proxy=http://$MSRV:3142" >> /etc/yum.conf + fi fi else # Set it up so the updates roll through the manager