diff --git a/gogs-change-hook-path.sh b/git-repo-change-hook-path.sh similarity index 74% rename from gogs-change-hook-path.sh rename to git-repo-change-hook-path.sh index 46bde7c..6415195 100755 --- a/gogs-change-hook-path.sh +++ b/git-repo-change-hook-path.sh @@ -1,6 +1,6 @@ #!/bin/bash -echo "in [RepoRoot]/*/*/hooks/post-receive & pre-receive, gogs is hard-coded with full path such as /faronear/git/gogs, you need to replace it if the path is changed." +echo "in [RepoRoot]/*/*/hooks/[pre|update|post]-receive.d/*, path is hard-coded in full such as `/faronear/git/gitea/custom/conf/app.ini`, you need to replace it if the path is changed." read -p "Enter old hook path: >> " OLDPATH read -p "Enter new hook path: >> " NEWPATH read -p "Enter repository root path: >> " REPOROOT diff --git a/press-anykey-to-exit.sh b/press-anykey-to-exit.sh index 1856a4b..c0b11a4 100755 --- a/press-anykey-to-exit.sh +++ b/press-anykey-to-exit.sh @@ -13,3 +13,6 @@ get_char() echo "Press any key to exit!" char=`get_char` + +# read -p "press Enter to exit!" +# echo "Bye!" \ No newline at end of file diff --git a/proxy.sh b/proxy.sh new file mode 100755 index 0000000..6010469 --- /dev/null +++ b/proxy.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +function proxy(){ + echo "=== 开启或关闭网络代理? u for up, d for down, anything else for no change." + read -p ">>> " proxySwitch + if [ $proxySwitch ] && [ $proxySwitch == "u" ] + then + export ALL_PROXY=socks5://127.0.0.1:1090 + export http_proxy=http://127.0.0.1:41091 + export https_proxy=https://127.0.0.1:41091 + echo -e "--- 已开启网络代理" + elif [ $proxySwitch ] && [ $proxySwitch == "d" ] + then + unset ALL_PROXY + unset http_proxy + unset https_proxy + echo -e "--- 已关闭网络代理" + else + echo "--- Nothing changed." + fi +} +proxy