Skip to content

Commit a50d085

Browse files
committed
script used to switch local and remote network
1 parent d203682 commit a50d085

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

linux_conf/script/bashrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
alias ls='ls -G --color'
2+
alias mtree="find . -print | sed -e 's;[^/]*/;|________;g;s;________|; |;g'"
3+
alias tree="tree $@ --charset=unicode|LC_CTYPE=C sed 's/-/--/g; s/ / /g;s/-- /--- /g'"

linux_conf/script/internet

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
export http_proxy=http://xxx.xxx.xxx.xxx:80/
3+
export ftp_proxy=ftp://xxx.xxx.xxx.xxx:80/
4+
export socks_proxy=socks://xxx.xxx.xxx.xxx:80/
5+
export https_proxy=https://xxx.xxx.xxx.xxx:80/
6+
7+
if [ -z $(git config --global --name-only -l |grep remote.origin.proxy |xargs) ]
8+
then
9+
git config --global --add remote.origin.proxy ""
10+
fi
11+
gsed -i 's/proxy.*/proxy = xxx\.xxx\.xxx\.xxx:80/' ~/.gitconfig
12+
13+
if [ -z $(git config --global --name-only -l |grep user.name |xargs) ]
14+
then
15+
git config --global --add user.name ""
16+
fi
17+
gsed -i 's/name.*/name = xxxxx/' ~/.gitconfig
18+
19+
if [ -z $(git config --global --name-only -l |grep user.email |xargs) ]
20+
then
21+
git config --global --add user.email ""
22+
fi
23+
gsed -i 's/email.*/email = [email protected]/' ~/.gitconfig

linux_conf/script/localnet

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
unset http_proxy ftp_proxy socks_proxy https_proxy
3+
if [ -z $(git config --global --name-only -l |grep remote.origin.proxy |xargs) ]
4+
then
5+
git config --global --add remote.origin.proxy ""
6+
fi
7+
gsed -i 's/proxy *= *[0-9.:]*/proxy =/' ~/.gitconfig
8+
9+
if [ -z $(git config --global --name-only -l |grep user.name |xargs) ]
10+
then
11+
git config --global --add user.name ""
12+
fi
13+
gsed -i 's/name.*/name = xxxx/' ~/.gitconfig
14+
15+
if [ -z $(git config --global --name-only -l |grep user.email |xargs) ]
16+
then
17+
git config --global --add user.email ""
18+
fi
19+
gsed -i 's/email.*/email = xxxx@xxx/' ~/.gitconfig

0 commit comments

Comments
 (0)