From 5c7b570254b99e6f995b7562d17e2fe73f094412 Mon Sep 17 00:00:00 2001 From: Nostrus Admin Date: Sat, 23 Nov 2024 10:01:44 -0500 Subject: [PATCH] Added root check to patch.sh and patch-fbc.sh --- patch-fbc.sh | 9 +++++++++ patch.sh | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/patch-fbc.sh b/patch-fbc.sh index 4d54735..d7c7522 100755 --- a/patch-fbc.sh +++ b/patch-fbc.sh @@ -4,6 +4,15 @@ set -euo pipefail ; # <- this semicolon and comment make options apply # even when script is corrupt by CRLF line terminators (issue #75) # empty line must follow this comment for immediate fail with CRLF newlines +# root check +if [ "$(id -u)" -ne 0 ]; then + echo + echo -e "Please run as root!" + echo + exit 1 +fi + + backup_path="/opt/nvidia/libnvidia-fbc-backup" silent_flag='' manual_driver_version='' diff --git a/patch.sh b/patch.sh index b6e6ab8..fb3d0fd 100755 --- a/patch.sh +++ b/patch.sh @@ -4,6 +4,15 @@ set -euo pipefail ; # <- this semicolon and comment make options apply # even when script is corrupt by CRLF line terminators (issue #75) # empty line must follow this comment for immediate fail with CRLF newlines +# root check +if [ "$(id -u)" -ne 0 ]; then + echo + echo -e "Please run as root!" + echo + exit 1 +fi + + backup_path="/opt/nvidia/libnvidia-encode-backup" silent_flag='' manual_driver_version=''