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"