-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# Tools | ||
Personal kit | ||
|
||
## proxy.sh | ||
set or unset proxy for terminal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
######################################################################### | ||
# File Name: /home/midcheck/Script/proxy.sh | ||
# Author: MidCHeck | ||
# mail: [email protected] | ||
# Created Time: 2020年02月23日 星期日 22时39分51秒 | ||
######################################################################### | ||
#!/bin/env bash | ||
|
||
if [ $1 == "unset" ] 2> /dev/null ; then | ||
echo "取消代理..." | ||
unset http_proxy | ||
unset https_proxy | ||
unset ftp_proxy | ||
unset all_proxy | ||
exit; | ||
elif test -z "$2"; then | ||
if test -z "$1"; then | ||
echo "输入ip" | ||
else | ||
echo "输入端口" | ||
fi | ||
echo "Usage: proxy [unset | ip] [port]" | ||
exit; | ||
else | ||
echo "添加代理 http://$1:$2/" | ||
export http_proxy=http://$1:$2/ | ||
export https_proxy=http://$1:$2/ | ||
export ftp_proxy=http://$1:$2/ | ||
export all_proxy=http://$1:$2/ | ||
fi |