From e0e81a022d6203bdcca13d03fbf6c4faf9cc6d02 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 26 Sep 2023 17:55:13 -0400 Subject: [PATCH] Update build.func Please run these scripts as root (not with sudo). --- misc/build.func | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/misc/build.func b/misc/build.func index c1c9394f..90d24563 100644 --- a/misc/build.func +++ b/misc/build.func @@ -52,6 +52,15 @@ msg_error() { echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" } +# Run as root only +if [[ "$(id -u)" -ne 0 || $(ps -o comm= -p $PPID) == "sudo" ]]; then + clear + msg_error "Please run this script as root." + echo -e "\nExiting..." + sleep 2 + exit +fi + # This function checks the version of Proxmox Virtual Environment (PVE) and exits if the version is not supported. pve_check() { if [ $(pveversion | grep "pve-manager/8" | wc -l) -ne 1 ]; then