From 78260a4599231e9df42373634a8794e5ef58b5fd Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sat, 11 Nov 2023 21:46:24 +0800 Subject: [PATCH] y --- ...ursively.sh => find-and-run-recursively.sh | 2 +- mac-homebrew-china.sh | 19 +++++++++++++++++++ ...all-homebrew.sh => mac-homebrew-install.sh | 0 proxy.sh | 7 +++---- 4 files changed, 23 insertions(+), 5 deletions(-) rename run-files-recursively.sh => find-and-run-recursively.sh (97%) create mode 100644 mac-homebrew-china.sh rename mac-install-homebrew.sh => mac-homebrew-install.sh (100%) mode change 100755 => 100644 diff --git a/run-files-recursively.sh b/find-and-run-recursively.sh similarity index 97% rename from run-files-recursively.sh rename to find-and-run-recursively.sh index 62c4c9e..1741867 100644 --- a/run-files-recursively.sh +++ b/find-and-run-recursively.sh @@ -17,7 +17,7 @@ fi read -p "maxdepth >>> " MAXDEPTH if [ "$MAXDEPTH" ] then - MAXDEPTH_CLAUSE="-mindepth $MAXDEPTH" + MAXDEPTH_CLAUSE="-maxdepth $MAXDEPTH" fi echo "To find file or directory? [f] for file, [d] for directory, [l] for link, [leave blank] for all:" diff --git a/mac-homebrew-china.sh b/mac-homebrew-china.sh new file mode 100644 index 0000000..6ad1040 --- /dev/null +++ b/mac-homebrew-china.sh @@ -0,0 +1,19 @@ +echo === Enter [g] to reset git source to github, [c] to mirrors in china +read -p '>>> ' TARGET + +if [ "$TARGET"='g' ] +then + git -C /usr/local/Homebrew remote set-url origin https://github.com/Homebrew/brew.git + git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core remote set-url origin https://github.com/Homebrew/homebrew-core.git + git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask remote set-url origin https://github.com/Homebrew/homebrew-cask +elif [ "$TARGET"='c' ] +then + git -C /usr/local/Homebrew remote set-url origin https://mirrors.ustc.edu.cn/brew.git + # 或 https://mirrors.aliyun.com/homebrew/brew.git + git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git + # 或 https://mirrors.aliyun.com/homebrew/homebrew-core.git + git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git + export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles +fi + +# https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/ diff --git a/mac-install-homebrew.sh b/mac-homebrew-install.sh old mode 100755 new mode 100644 similarity index 100% rename from mac-install-homebrew.sh rename to mac-homebrew-install.sh diff --git a/proxy.sh b/proxy.sh index 8d83a2e..f0ac8ea 100755 --- a/proxy.sh +++ b/proxy.sh @@ -18,9 +18,8 @@ function proxy(){ else echo "--- Nothing changed." fi - - echo 测试 ip.gs, ip.sb, ipinfo.io - curl ipinfo.io - } proxy +echo 测试 ip.gs, ip.sb, ipinfo.io +curl ipinfo.io +echo " "