I have googling around for long time but couldn't actually find a reliable way.
This is what I want:
Use Bash script, check if user is actually root root, not the user with sudo command.
I have tried many ways , like id -u
, $EUID
, whoami
, etc., but all of them return same value when run as root and using sudo.