-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttpProxy.sh
More file actions
executable file
·31 lines (22 loc) · 927 Bytes
/
httpProxy.sh
File metadata and controls
executable file
·31 lines (22 loc) · 927 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
#!/bin/bash
#https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man8/networksetup.8.html
network="Wi-Fi"
httpproxy="jenkins.nanchao.org"
port="7777"
switch=$1
if [ "$switch" = "close" ]
then
networksetup -setwebproxystate $network off
networksetup -setsecurewebproxystate $network off
networksetup -setproxybypassdomains $network Empty
networksetup -setautoproxystate $network off
networksetup -setsocksfirewallproxystate $network off
echo successfully shutdown proxy
else
networksetup -setwebproxy $network $httpproxy $port off
networksetup -setsecurewebproxy $network $httpproxy $port off
networksetup -setproxybypassdomains $network 127.0.0.1 192.168.0.0/16 10.0.0.0/8 172.16.0.0/12 localhost *.local
networksetup -setautoproxystate $network off
networksetup -setsocksfirewallproxystate $network off
echo successfully setup proxy
fi