diff --git a/examples/local/101_initial_cluster.sh b/examples/local/101_initial_cluster.sh index 134ddbd65b5..9eb6bab0e9c 100755 --- a/examples/local/101_initial_cluster.sh +++ b/examples/local/101_initial_cluster.sh @@ -22,6 +22,11 @@ set -e # shellcheck disable=SC2128 script_root=$(dirname "${BASH_SOURCE}") +if [[ $EUID -eq 0 ]]; then + echo "This script refuses to be run as root. Please switch to a regular user." + exit 1 +fi + # start topo server if [ "${TOPO}" = "zk2" ]; then CELL=zone1 "$script_root/zk-up.sh"