更新 1.sh 脚本,移除 Alpine 系统 bash_aliases 的 TODO 注释,并添加软链接创建功能

This commit is contained in:
mini2024
2025-04-06 02:15:30 +08:00
parent fbc7fd727c
commit a4bf202096

11
1.sh
View File

@ -101,8 +101,6 @@ modify_authorized_keys() {
} }
bash_aliases() { bash_aliases() {
# TODO: Alpine 用的不是 /root/.bash_aliases
# /etc/profile.d/00-bashrc.sh
print_green "###################" print_green "###################"
print_green "## bash_aliases ###" print_green "## bash_aliases ###"
print_green "###################" print_green "###################"
@ -126,6 +124,15 @@ alias ddown='docker compose down'
alias dup='docker compose up --remove-orphans' alias dup='docker compose up --remove-orphans'
EOF 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 "请执行以下命令使配置生效:" print_yellow "请执行以下命令使配置生效:"
print_yellow "source /root/.bashrc" print_yellow "source /root/.bashrc"