From f1c5f7598cf143b8388c65127ea43d32d40dae44 Mon Sep 17 00:00:00 2001 From: Sam Sesh Date: Tue, 13 Jun 2023 16:30:46 +0330 Subject: [PATCH] check root --- install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install.sh b/install.sh index 996918e..1bace4f 100644 --- a/install.sh +++ b/install.sh @@ -1,5 +1,13 @@ #!/bin/bash +# Check Root User + +# If you want to run as another user, please modify $EUID to be owned by this user +if [[ "$EUID" -ne '0' ]]; then + echo "$(tput setaf 1)Error: You must run this script as root!$(tput sgr0)" + exit 1 +fi + # Set the desired GitHub repository repo="go-gost/gost" base_url="https://api.github.com/repos/$repo/releases"