From 982e1064c263e0d4fea6167a72f2d2dcdbc293a2 Mon Sep 17 00:00:00 2001 From: sjlleo Date: Mon, 23 May 2022 09:45:59 +0800 Subject: [PATCH] update: sudo check first --- nt_install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nt_install.sh b/nt_install.sh index 8fc4f80..5fa9526 100644 --- a/nt_install.sh +++ b/nt_install.sh @@ -1,5 +1,9 @@ #!/bin/bash +checkRootPermit() { + [[ $EUID -ne 0 ]] && echo "请使用sudo/root权限运行本脚本" && exit 1 +} + checkSystemArch() { arch=$(uname -m) if [[ $arch == "x86_64" ]]; then