From 26fcfa6c0c2f29650048ea18ab0cf037284b19f3 Mon Sep 17 00:00:00 2001 From: sdohuajia <63113882+sdohuajia@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:32:30 +0800 Subject: [PATCH] Update Waku.sh --- Waku.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Waku.sh b/Waku.sh index 589c644..4af697e 100644 --- a/Waku.sh +++ b/Waku.sh @@ -1,5 +1,15 @@ #!/bin/bash +# 检查是否以root用户运行脚本 +if [ "$(id -u)" != "0" ]; then + echo "此脚本需要以root用户权限运行。" + echo "请尝试使用 'sudo -i' 命令切换到root用户,然后再次运行此脚本。" + exit 1 +fi + +# 脚本保存路径 +SCRIPT_PATH="$HOME/Waku.sh" + # 主菜单函数 function main_menu() { while true; do