From 9f2917bb318970a9a4cec9902a884557b155c0f5 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 27 Dec 2018 06:54:34 -0500 Subject: [PATCH] Check for root in governor.sh --- TestScripts/governor.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TestScripts/governor.sh b/TestScripts/governor.sh index 982e1b89..a1f571d0 100755 --- a/TestScripts/governor.sh +++ b/TestScripts/governor.sh @@ -12,6 +12,11 @@ if [[ -z "$BASH_SOURCE" ]]; then BASH_SOURCE="$0" fi +if [[ "$EUID" -ne 0 ]]; then + echo "This script must be run as root" + [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 +fi + if [ "x$1" = "x" ]; then echo "usage: $0 on[demand]|pe[rformance]|po[wersave]|us[erspace]?" [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1