From cefe16ed346ee33a8c44501be48c7dfea760c1a6 Mon Sep 17 00:00:00 2001 From: smeb y <48400087+a3165458@users.noreply.github.com> Date: Wed, 20 Mar 2024 16:18:22 +0800 Subject: [PATCH] Update Artela.sh --- Artela.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Artela.sh b/Artela.sh index bfc49bb..1079449 100644 --- a/Artela.sh +++ b/Artela.sh @@ -1,5 +1,12 @@ #!/bin/bash +# 检查是否以root用户运行脚本 +if [ "$(id -u)" != "0" ]; then + echo "此脚本需要以root用户权限运行。" + echo "请尝试使用 'sudo -i' 命令切换到root用户,然后再次运行此脚本。" + exit 1 +fi + # 脚本保存路径 SCRIPT_PATH="$HOME/Artela.sh"