Check for root in governor.sh

pull/769/head
Jeffrey Walton 2018-12-27 06:54:34 -05:00
parent 0c658f5a7c
commit 9f2917bb31
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 5 additions and 0 deletions

View File

@ -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