diff --git a/1.sh b/1.sh index 3c7b513..646d004 100644 --- a/1.sh +++ b/1.sh @@ -130,8 +130,12 @@ EOF # . /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" + if [ ! -e "/etc/bash/root-bashrc.sh" ]; then + ln -s /root/.bashrc /etc/bash/root-bashrc.sh + echo "已创建软链接: /etc/bash/root-bashrc.sh" + else + echo "软链接已存在: /etc/bash/root-bashrc.sh" + fi fi print_yellow "别名配置已完成"