From 023a4af672b4061e03297fffddb53dd14f24440e Mon Sep 17 00:00:00 2001 From: IceCodeNew <32576256+IceCodeNew@users.noreply.github.com> Date: Thu, 26 Nov 2020 03:34:27 +0800 Subject: [PATCH] Apply suggestions from code review --- install-dat-release.sh | 6 +++--- install-release.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/install-dat-release.sh b/install-dat-release.sh index 9b3a165..b25b5cf 100644 --- a/install-dat-release.sh +++ b/install-dat-release.sh @@ -29,9 +29,9 @@ 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 "Warning: You are not root, and you may reach insufficient permission errors." - read -r -p "Are you sure you want to continue? [y/N] " prompt - if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then + echo "${red}warning: ${green}The user currently executing this script is not root. You may encounter the insufficient privilege error.${reset}" + 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..." diff --git a/install-release.sh b/install-release.sh index 723bbd3..ac782ea 100644 --- a/install-release.sh +++ b/install-release.sh @@ -47,9 +47,9 @@ 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 "Warning: You are not root, and you may reach insufficient permission errors." - read -r -p "Are you sure you want to continue? [y/N] " prompt - if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then + echo "${red}warning: ${green}The user currently executing this script is not root. You may encounter the insufficient privilege error.${reset}" + 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..."