Skip to content

Commit 6ee6208

Browse files
committed
sudo detection...
1 parent 1a0370b commit 6ee6208

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

cyberpanel.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,13 +610,18 @@ fi
610610

611611
check_root() {
612612
echo -e "\nChecking root privileges...\n"
613+
if echo $(set) | grep SUDO > /dev/null ; then
614+
echo -e "\nYou are using SUDO , please run as root user...\n"
615+
exit
616+
fi
617+
613618
if [[ $(id -u) != 0 ]] > /dev/null; then
614-
echo -e "You must use root account to do this"
615-
echo -e "or run following command: (do NOT miss the quotes)"
616-
echo -e "\e[31msudo su -c \"sh <(curl https://cyberpanel.sh || wget -O - https://cyberpanel.sh)\"\e[39m"
619+
echo -e "\nYou must use root user to install CyberPanel...\n"
620+
# echo -e "or run following command: (do NOT miss the quotes)"
621+
# echo -e "\e[31msudo su -c \"sh <(curl https://cyberpanel.sh || wget -O - https://cyberpanel.sh)\"\e[39m"
617622
exit 1
618623
else
619-
echo -e "You are runing as root...\n"
624+
echo -e "\nYou are runing as root...\n"
620625
fi
621626
}
622627

0 commit comments

Comments
 (0)