From 5c3f651e7b79716eac472fa97a71f593a6b0d57a Mon Sep 17 00:00:00 2001 From: mini2024 Date: Sun, 6 Apr 2025 02:18:44 +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=E4=BC=98=E5=8C=96=20Alpine=20=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=B8=8B=E7=9A=84=20shadow=20=E5=8C=85=E5=AE=89=E8=A3=85?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=20--no-cache=20=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E4=BB=A5=E5=87=8F=E5=B0=91=E7=BC=93=E5=AD=98=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/1.sh b/1.sh index 6f6c85b..3c7b513 100644 --- a/1.sh +++ b/1.sh @@ -21,11 +21,12 @@ if [ -f /etc/debian_version ]; then chsh -s $(which bash) print_green "已将 bash 设置为默认 shell" elif [ -f /etc/alpine-release ]; then - apk add shadow + apk add --no-cache shadow chsh -s $(which bash) root # sed -i 's|^\(root:.*\):[^:]*$|\1:/bin/bash|' /etc/passwd # sed -i 's|^\(root:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*\):[^:]*$|\1:/bin/bash|' /etc/passwd print_yellow "已将 bash 设置为默认 shell" + apk del shadow fi # 先检查是 Debian 还是 Alpine