Skip to content

Commit

Permalink
添加命令行代理
Browse files Browse the repository at this point in the history
  • Loading branch information
MidCheck committed Feb 24, 2020
1 parent 485f269 commit 3912d90
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
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
30 changes: 30 additions & 0 deletions proxy.sh
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

0 comments on commit 3912d90

Please sign in to comment.