diff --git a/1.sh b/1.sh index ce9d876..c66da03 100644 --- a/1.sh +++ b/1.sh @@ -12,6 +12,18 @@ print_red() { echo -e "\033[31m\033[01m$1$2\033[0m"; } print_green() { echo -e "\033[32m\033[01m$1$2\033[0m"; } print_yellow() { echo -e "\033[33m\033[01m$1$2\033[0m"; } +# 设置 bash 为默认 shell +print_green "###################" +print_green "##### shell ######" +print_green "###################" +if [ -f /etc/debian_version ]; then + chsh -s $(which bash) + print_green "已将 bash 设置为默认 shell" +elif [ -f /etc/alpine-release ]; then + sed -i 's/^root:.*/root:\/bin\/bash/' /etc/passwd + print_green "已将 bash 设置为默认 shell" +fi + # 先检查是 Debian 还是 Alpine if [ -f /etc/debian_version ]; then SYSTEM_TYPE="debian"