From 622bff338cb995ae548d2e5be0e231cc5f79d5dd Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sat, 4 Mar 2023 16:03:03 +0800 Subject: [PATCH] =?UTF-8?q?root=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- InstallBox86.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/InstallBox86.sh b/InstallBox86.sh index 2270791..e5742d1 100755 --- a/InstallBox86.sh +++ b/InstallBox86.sh @@ -1,4 +1,10 @@ #!/bin/bash +if [[ `whoami` != `root` ]]; then + echo 请以 root 权限运行 + echo 按任意键退出 + read + exit 1 +fi PCArch=`dpkg --print-architecture` if [[ $PCArch != "aarch64" ]] && [[ $PCArch != "arm64" ]]; then echo 非 ARM 架构,无法继续 @@ -8,7 +14,7 @@ if [[ $PCArch != "aarch64" ]] && [[ $PCArch != "arm64" ]]; then fi if [[ -f /etc/apt/sources.list.d/box86.list ]]; then echo 已安装,结束 - echo 按任意键退出 + echo 按回车键退出 read exit 1 fi @@ -24,5 +30,5 @@ fi echo " + sudo apt update" sudo apt update sudo apt install -y $installBox -echo 安装完成! +echo 安装完成!按回车键退出 read \ No newline at end of file