Apply suggestions from code review

pull/184/head
IceCodeNew 2020-11-26 03:34:27 +08:00 committed by GitHub
parent dd0155d1aa
commit 023a4af672
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -29,9 +29,9 @@ curl() {
check_if_running_as_root() { check_if_running_as_root() {
# If you want to run as another user, please modify $UID to be owned by this user # If you want to run as another user, please modify $UID to be owned by this user
if [[ "$UID" -ne '0' ]]; then if [[ "$UID" -ne '0' ]]; then
echo "Warning: You are not root, and you may reach insufficient permission errors." 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] " prompt read -r -p "Are you sure you want to continue? [y/n] " cont_without_been_root
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then if [[ x"${cont_without_been_root:0:1}" = x'y' ]]; then
echo "Continuing the installation with current user..." echo "Continuing the installation with current user..."
else else
echo "Not running with root, exiting..." echo "Not running with root, exiting..."

View File

@ -47,9 +47,9 @@ systemd_cat_config() {
check_if_running_as_root() { check_if_running_as_root() {
# If you want to run as another user, please modify $UID to be owned by this user # If you want to run as another user, please modify $UID to be owned by this user
if [[ "$UID" -ne '0' ]]; then if [[ "$UID" -ne '0' ]]; then
echo "Warning: You are not root, and you may reach insufficient permission errors." 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] " prompt read -r -p "Are you sure you want to continue? [y/n] " cont_without_been_root
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then if [[ x"${cont_without_been_root:0:1}" = x'y' ]]; then
echo "Continuing the installation with current user..." echo "Continuing the installation with current user..."
else else
echo "Not running with root, exiting..." echo "Not running with root, exiting..."