From 07a829acf07289a305b28505866f3ae74fb1d0cd Mon Sep 17 00:00:00 2001 From: Nicholas Wang Date: Wed, 25 Nov 2020 13:38:44 -0600 Subject: [PATCH] attempt of fix to #182 (#184) Co-authored-by: IceCodeNew <32576256+IceCodeNew@users.noreply.github.com> --- install-dat-release.sh | 10 ++++++++-- install-release.sh | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/install-dat-release.sh b/install-dat-release.sh index cf5093a..84e9f17 100644 --- a/install-dat-release.sh +++ b/install-dat-release.sh @@ -29,8 +29,14 @@ curl() { check_if_running_as_root() { # If you want to run as another user, please modify $UID to be owned by this user if [[ "$UID" -ne '0' ]]; then - echo "error: You must run this script as root!" - exit 1 + echo "WARNING: The user currently executing this script is not root. You may encounter the insufficient privilege error." + read -r -p "Are you sure you want to continue? [y/n] " cont_without_been_root + if [[ x"${cont_without_been_root:0:1}" = x'y' ]]; then + echo "Continuing the installation with current user..." + else + echo "Not running with root, exiting..." + exit 1 + fi fi } diff --git a/install-release.sh b/install-release.sh index 54b1219..ebe8eec 100644 --- a/install-release.sh +++ b/install-release.sh @@ -47,8 +47,14 @@ systemd_cat_config() { check_if_running_as_root() { # If you want to run as another user, please modify $UID to be owned by this user if [[ "$UID" -ne '0' ]]; then - echo "error: You must run this script as root!" - exit 1 + echo "WARNING: The user currently executing this script is not root. You may encounter the insufficient privilege error." + read -r -p "Are you sure you want to continue? [y/n] " cont_without_been_root + if [[ x"${cont_without_been_root:0:1}" = x'y' ]]; then + echo "Continuing the installation with current user..." + else + echo "Not running with root, exiting..." + exit 1 + fi fi }