From 6ee62087f720c0f9ee7d189fe8f0bb888c9d4c05 Mon Sep 17 00:00:00 2001 From: qtwrk Date: Mon, 13 Jan 2020 14:00:32 +0100 Subject: [PATCH] sudo detection... --- cyberpanel.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 04e058d90..c45f0a65a 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -610,13 +610,18 @@ fi check_root() { echo -e "\nChecking root privileges...\n" +if echo $(set) | grep SUDO > /dev/null ; then + echo -e "\nYou are using SUDO , please run as root user...\n" + exit +fi + if [[ $(id -u) != 0 ]] > /dev/null; then - echo -e "You must use root account to do this" - echo -e "or run following command: (do NOT miss the quotes)" - echo -e "\e[31msudo su -c \"sh <(curl https://cyberpanel.sh || wget -O - https://cyberpanel.sh)\"\e[39m" + echo -e "\nYou must use root user to install CyberPanel...\n" +# echo -e "or run following command: (do NOT miss the quotes)" +# echo -e "\e[31msudo su -c \"sh <(curl https://cyberpanel.sh || wget -O - https://cyberpanel.sh)\"\e[39m" exit 1 else - echo -e "You are runing as root...\n" + echo -e "\nYou are runing as root...\n" fi }