From ebdd72f300e6e8985757c2381a218eb905d69d41 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Tue, 10 May 2016 15:20:39 -0700 Subject: [PATCH] add root check since it's required --- discourse-setup | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/discourse-setup b/discourse-setup index 268fa03..d05d3fb 100755 --- a/discourse-setup +++ b/discourse-setup @@ -1,5 +1,15 @@ #!/bin/bash +## +## Make sure only root can run our script +## +check_root() { + if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root. Please sudo or log in as root first." 1>&2 + exit 1 + fi +} + ## ## Do we have enough memory and disk space for Discourse? ## @@ -389,6 +399,7 @@ changelog=/tmp/changelog ## ## Check requirements before creating a copy of a config file we won't edit ## +check_root check_disk_and_memory check_ports -- 2.25.1