Unverified Commit 7b27d976 authored by David Beniamine's avatar David Beniamine
Browse files

Set proxy in bashrc

parent 5deadbe5
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -2,7 +2,24 @@

file="/etc/apt/apt.conf.d/70debconf"
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::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