diff --git a/ore.sh b/ore.sh index 080792b..47393a5 100644 --- a/ore.sh +++ b/ore.sh @@ -1,5 +1,12 @@ #!/bin/bash +# 检查是否以root用户运行脚本 +if [ "$(id -u)" != "0" ]; then + echo "此脚本需要以root用户权限运行。" + echo "请尝试使用 'sudo -i' 命令切换到root用户,然后再次运行此脚本。" + exit 1 +fi + function install_node() {