From e5581fc9c2c8c039345db7b90058e6ac05969596 Mon Sep 17 00:00:00 2001
From: Weilbyte <me@weilbyte.dev>
Date: Wed, 28 Jul 2021 15:17:21 +0000
Subject: [PATCH] Add root check (fixes #84)

---
 PVEDiscordDark.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/PVEDiscordDark.sh b/PVEDiscordDark.sh
index 9f765cd..95e4fbb 100644
--- a/PVEDiscordDark.sh
+++ b/PVEDiscordDark.sh
@@ -20,6 +20,11 @@ BASE_URL="https://raw.githubusercontent.com/$REPO/$TAG"
 #endregion Consts
 
 #region Prerun checks
+if [[ $EUID -ne 0 ]]; then
+    echo -e >&2 "${BRED}Root privileges are required to perform this operation${REG}";
+    exit 1
+fi
+
 hash sed 2>/dev/null || { 
     echo -e >&2 "${BRED}sed is required but missing from your system${REG}";
     exit 1;
-- 
GitLab