From a4bf202096391d13d2966a2cda61c92c3dd96479 Mon Sep 17 00:00:00 2001 From: mini2024 Date: Sun, 6 Apr 2025 02:15:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=201.sh=20=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=EF=BC=8C=E7=A7=BB=E9=99=A4=20Alpine=20=E7=B3=BB=E7=BB=9F=20bas?= =?UTF-8?q?h=5Faliases=20=E7=9A=84=20TODO=20=E6=B3=A8=E9=87=8A=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E6=B7=BB=E5=8A=A0=E8=BD=AF=E9=93=BE=E6=8E=A5=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/1.sh b/1.sh index f2b0a9a..6f6c85b 100644 --- a/1.sh +++ b/1.sh @@ -101,8 +101,6 @@ modify_authorized_keys() { } bash_aliases() { - # TODO: Alpine 用的不是 /root/.bash_aliases - # /etc/profile.d/00-bashrc.sh print_green "###################" print_green "## bash_aliases ###" print_green "###################" @@ -126,6 +124,15 @@ alias ddown='docker compose down' alias dup='docker compose up --remove-orphans' EOF + # 如果是 Alpine 系统,创建一个软链接。 + # /etc/profile.d/00-bashrc.sh + # . /etc/bash/bashrc + # . /etc/bash/*.sh + if [ "$SYSTEM_TYPE" = "alpine" ]; then + ln -s /root/.bashrc /etc/bash/root-bashrc.sh + echo "已创建软链接: /etc/bash/root-bashrc.sh" + fi + print_yellow "别名配置已完成" print_yellow "请执行以下命令使配置生效:" print_yellow "source /root/.bashrc"