mirror of
https://gitlab.com/dabruh/dotfiles.git
synced 2024-12-25 19:44:17 +01:00
Prevent running as root
This commit is contained in:
parent
0adf10cfe9
commit
b588774f7e
1 changed files with 6 additions and 1 deletions
|
@ -345,6 +345,11 @@ function setup_debian() {
|
|||
change_shell || return 13
|
||||
}
|
||||
|
||||
if [ "$EUID" -eq 0 ]; then
|
||||
echo "Don't run this script as root." 1>&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
ID_LIKE="$(grep ID_LIKE= </etc/os-release | cut -d= -f2)"
|
||||
|
||||
echo "Setting up ${ID_LIKE^:?}-like OS."
|
||||
|
@ -355,7 +360,7 @@ elif [[ "$ID_LIKE" == "debian" ]]; then
|
|||
setup_debian || echo "Setup failed: $?"
|
||||
else
|
||||
echo "ERROR: Unsupported system: ID_LIKE=$ID_LIKE"
|
||||
exit 2
|
||||
exit 3
|
||||
fi
|
||||
|
||||
echo "Setup finished."
|
||||
|
|
Loading…
Reference in a new issue