aurora1778453
install.sh: prevent user from running this script as root
+7 −0
1 file changed
- M install.sh +7 −0
| @@ -15,6 +15,13 @@ log() { | |||
| 15 | 15 | "$color" "$(date '+%H:%M:%S')" "$level" '\033[0m' "$*" | |
| 16 | 16 | } | |
| 17 | 17 | ||
| 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 | + | ||
| 18 | 25 | currentDir="$(dirname "$(readlink -f "$0")")" | |
| 19 | 26 | cd "$currentDir" | |
| 20 | 27 | ||