Krolyxon
Commit 1778453

Branches

Refs →

aurora1778453

install.sh: prevent user from running this script as root

Author
krolxon
Date
2026-01-01 18:12 +0530
Parent
b1341a6
Commit
177845352d6469f52bfd1c7d56e16fbeb4ecb245

+7 −0

1 file changed

  1. M install.sh +7 −0
M install.sh View
@@ -15,6 +15,13 @@ log() {
1515 "$color" "$(date '+%H:%M:%S')" "$level" '\033[0m' "$*"
1616 }
1717
18+# Prevent user from running this script as root
19+if [[ "$EUID" -eq 0 ]]; then
20+ log ERROR "This script must NOT be run as root."
21+ log INFO "If you need elevated privileges, the script will ask for sudo when required."
22+ exit 1
23+fi
24+
1825 currentDir="$(dirname "$(readlink -f "$0")")"
1926 cd "$currentDir"
2027