34 lines
909 B
Bash
Executable File
34 lines
909 B
Bash
Executable File
#!/bin/bash
|
|
|
|
read -p "Enter last proxy IP digit(s) (100.64.1.XX): " proxy_end
|
|
|
|
declare PROXY_ADDRESS=100.64.1.$proxy_end
|
|
declare PROXY_PORT=8080
|
|
|
|
echo "Configuring http(s)_proxy environment variable to $PROXY_ADDRESS:$PROXY_PORT"
|
|
|
|
export https_proxy=http://$PROXY_ADDRESS:$PROXY_PORT
|
|
export http_proxy=http://$PROXY_ADDRESS:$PROXY_PORT
|
|
|
|
echo Configuring git
|
|
|
|
git config --global --unset http.proxy
|
|
git config --global http.proxy http://$PROXY_ADDRESS:$PROXY_PORT
|
|
git config --global https.proxy http://$PROXY_ADDRESS:$PROXY_PORT
|
|
git config --global http.sslVerify false
|
|
|
|
echo "Configuring apt (elevated rights required)"
|
|
|
|
# Edit /etc/apt/apt.conf.d/proxy.conf
|
|
cat > ~/proxy.conf <<EOL
|
|
Acquire {
|
|
HTTP_PROXY="http://$PROXY_ADDRESS:$PROXY_PORT/";
|
|
HTTPS_PROXY="https://$PROXY_ADDRESS:$PROXY_PORT/";
|
|
}
|
|
EOL
|
|
|
|
sudo cp ~/proxy.conf /etc/apt/apt.conf.d/
|
|
rm ~/proxy.conf
|
|
|
|
echo /etc/Apt/apt.conf.d/proxy.conf updated
|