From 91283603629ac3cb54c0d938ea4ed7734707ad7d Mon Sep 17 00:00:00 2001 From: mfgbhatti Date: Mon, 24 Jan 2022 20:12:25 +0000 Subject: [PATCH] some background check functions --- startup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/startup.sh b/startup.sh index 5272a95..71c28aa 100644 --- a/startup.sh +++ b/startup.sh @@ -23,6 +23,14 @@ set_option() { # else add option echo "${1}=${2}" >> "$CONFIG_FILE" } +# Adding global functions and variables to use in this script + +check_root() { + if [[ "$(id -u)" != "0" ]]; then + echo -ne "Error: This script has to be run under the 'root' user!" + exit 1 + fi +} logo () { # This will be shown on every set as user is progressing