From 7fec07e3338dd9c29ee0753deebc259727b8b13f Mon Sep 17 00:00:00 2001 From: Nano Date: Thu, 3 Jul 2025 15:12:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a678d06..1f65531 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # lazy +一句话命令:`sh -c "$(wget -qO- cc.c-4.cc/lazy.sh)"` + +Gist: https://gist.github.com/Konano/d3236c9546a362438096eab1d380b4c7 + +---- + root 用户请使用 [init_root.sh](./init_root.sh) 有 sudo 权限的普通用户请使用 [init_sudo.sh](./init_sudo.sh) From 05f2644f9bb82d7ca74165a3cd69e4fcb514be68 Mon Sep 17 00:00:00 2001 From: Konano Date: Thu, 3 Jul 2025 15:49:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E7=94=A8=20brew=20=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E7=9A=84=E8=BD=AF=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configure_priv.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/configure_priv.sh b/configure_priv.sh index 65d72cb..39fed37 100755 --- a/configure_priv.sh +++ b/configure_priv.sh @@ -61,8 +61,8 @@ configure_install_basic() { configure_install_useful() { if [ "$(uname)" = "Darwin" ]; then [ "$1" != "noupdate" ] && brew update - brew install hexyl bat tree p7zip-full - brew install hping3 mtr + brew install hexyl bat tree p7zip + brew install mtr else [ "$1" != "noupdate" ] && sudo apt-get update sudo apt-get install hexyl bat tree fd-find fzf -y @@ -182,7 +182,13 @@ configure_zsh() { # 如果 ~/.zshrc 里面没有 source ~/.zsh_user 则添加 if ! grep -qx "source ~/.zsh_user" ~/.zshrc; then - sed -i '$a source ~/.zsh_user' ~/.zshrc + if [ "$(uname)" = "Darwin" ]; then + # macOS + printf "\nsource ~/.zsh_user\n" >> ~/.zshrc + else + # Linux + sed -i '$a source ~/.zsh_user' ~/.zshrc + fi fi # 如果 ~/.zshrc 里面没有 conda initialize 则运行 mamba init zsh @@ -333,6 +339,8 @@ configure_fail2ban() { configure_iptables() { [ $offline -eq 1 ] && return + [ "$(uname)" = "Darwin" ] && return + if command_exists ifquery && systemctl is-active --quiet networking; then # ifupdown: /etc/network/if-pre-up.d/iptables-load [ -f /etc/network/if-pre-up.d/iptables-load ] && return