Set proxy in bashrc

parent 5deadbe5
...@@ -2,7 +2,24 @@ ...@@ -2,7 +2,24 @@
file="/etc/apt/apt.conf.d/70debconf" file="/etc/apt/apt.conf.d/70debconf"
sed -i '/Acquire::.*::Proxy/d' $file sed -i '/Acquire::.*::Proxy/d' $file
export https_proxy="http://pedago:3142" https_proxy="http://pedago:3142"
echo "Acquire::http::Proxy \"$https_proxy\";" >> $file echo "Acquire::http::Proxy \"$https_proxy\";" >> $file
echo "Acquire::https::Proxy \"$https_proxy\";" >> $file echo "Acquire::https::Proxy \"$https_proxy\";" >> $file
https_proxy="http://dnsproxy:3128"
for PROXY in HTTP_PROXY HTTPS_PROXY FTP_PROXY http_proxy https_proxy ftp_proxy
do
echo "export $PROXY=$https_proxy" >> /tmp/$$-bashrc
done
for h in /home/* /root;
do
if [ -z "$(grep HTTP_PROXY $h/.bashrc)" ]
then
u=$(basename $h)
cat /tmp/$$-bashrc $h/.bashrc > $h/.bashrc.new
mv $h/.bashrc.new $h/.bashrc
chown $u:$u $h/.bashrc
fi
done
rm /tmp/$$-bashrc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment