-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheasyproxy
More file actions
executable file
·40 lines (32 loc) · 825 Bytes
/
easyproxy
File metadata and controls
executable file
·40 lines (32 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
touch ~/.bashrc; cp ~/.bashrc ~/.bashrc.backup; b=~/.bashrc
exar=('export http_proxy=' 'export https_proxy=' 'export ftp_proxy=')
rm_proxy () {
echo Removing Proxy Settings from .bashrc
for x in "${exar[@]}"; do
sed -i "/$x/d" $b
done
}
mk_nullproxy () {
for i in "${exar[@]}"; do
echo "$i''" >> $b
done
}
f5 () {
echo Refeshing Terminal...
bash
}
echo 1. Set Proxy 2. Remove Proxy
read pChoice
if [ $pChoice -eq 1 ]; then
rm_proxy
echo Enter Username \(john.smith1\); read pUsername
echo Enter Password; read -s pPassword; echo ' '
fullproxy="http://$pUsername:$pPassword@proxy.det.nsw.edu.au:8080/"
for i in "${exar[@]}"; do
echo "$i$fullproxy" >> $b
done
f5
elif [ $pChoice -eq 2 ]; then
rm_proxy; mk_nullproxy; f5
fi