aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrolxon <krolyxon@tutanota.com>2026-01-01 18:12:58 +0530
committerkrolxon <krolyxon@tutanota.com>2026-01-01 18:12:58 +0530
commit177845352d6469f52bfd1c7d56e16fbeb4ecb245 (patch)
treeb40f0a9beb9f2b3f96c1a3ed576b5febb3b7af0c
parentb1341a67b17a28706cc9f85fe834af7b6057a107 (diff)
install.sh: prevent user from running this script as root
-rwxr-xr-xinstall.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/install.sh b/install.sh
index faeb8b3..543902c 100755
--- a/install.sh
+++ b/install.sh
@@ -15,6 +15,13 @@ log() {
"$color" "$(date '+%H:%M:%S')" "$level" '\033[0m' "$*"
}
+# Prevent user from running this script as root
+if [[ "$EUID" -eq 0 ]]; then
+ log ERROR "This script must NOT be run as root."
+ log INFO "If you need elevated privileges, the script will ask for sudo when required."
+ exit 1
+fi
+
currentDir="$(dirname "$(readlink -f "$0")")"
cd "$currentDir"