Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add entrypoint which auto detects proxy #3

Open
OhMyMndy opened this issue Sep 26, 2022 · 0 comments
Open

Add entrypoint which auto detects proxy #3

OhMyMndy opened this issue Sep 26, 2022 · 0 comments

Comments

@OhMyMndy
Copy link
Owner

OhMyMndy commented Sep 26, 2022

if nmap host.docker.internal -Pn -p 3128 &>/dev/null; then
  export http_proxy=http://host.docker.internal:3128
  export HTTPS_PROXY="$http_proxy"
  export HTTP_PROXY="$http_proxy"
  echo "check_certificate = off" > ~/.wgetrc
  echo "--insecure" > ~/.curlrc

  echo 'Acquire::http::Proxy "$http_proxy/";' | sudo tee /etc/apt/apt.conf.d/proxy.conf
  echo 'Acquire::https::Proxy "$http_proxy/";' | sudo tee -a /etc/apt/apt.conf.d/proxy.conf

else
  rm -f ~/.wgetrc ~/.curlrc
  sudo rm -f /etc/apt/apt.conf.d/proxy.conf
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant