Modified mechanizm of checking wether the script run as root or using sudo