From e75f8ba2575f6fa9aefa9ddd3c24832c8bf9941b Mon Sep 17 00:00:00 2001 From: William Wernert Date: Tue, 27 Oct 2020 09:39:29 -0400 Subject: [PATCH] [fix] Move root check to top of so-setup --- setup/so-functions | 9 --------- setup/so-setup | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 3c056d23f..2505e1616 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1003,15 +1003,6 @@ get_redirect() { fi } -got_root() { - # Make sure you are root - uid="$(id -u)" - if [ "$uid" -ne 0 ]; then - echo "This script must be run using sudo!" - exit 1 - fi -} - get_minion_type() { local minion_type case "$install_type" in diff --git a/setup/so-setup b/setup/so-setup index 1c46a8bf9..093b1d1fb 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -15,7 +15,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Make sure you are root before doing anything +uid="$(id -u)" +if [ "$uid" -ne 0 ]; then + echo "This script must be run using sudo!" + exit 1 +fi + cd "$(dirname "$0")" || exit 255 + source ./so-functions source ./so-common-functions source ./so-whiptail