From 71192f87327f175fbcb070d7d9f66ba17d41fb22 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Wed, 29 Nov 2023 02:36:57 -0600 Subject: [PATCH] add run as root check --- opensearch-1.x-node-installer.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/opensearch-1.x-node-installer.sh b/opensearch-1.x-node-installer.sh index faa93db..6085516 100644 --- a/opensearch-1.x-node-installer.sh +++ b/opensearch-1.x-node-installer.sh @@ -73,6 +73,12 @@ while [ $secs -gt 0 ]; do done } +#Check if user is root +if ! [ "$(id -u)" = 0 ]; then + echo "You need to be root or have sudo privileges!" + exit 0 +fi + # Test RAM size (4GB min) + CPUs (min 2) #Check system resources printf "\n\nVerifying System Resources:"