Closed syntroniks closed 9 years ago
(getlogin() ne "root") && die "$0 must be run by root!\n"; Doesn't seem to like sudo or even sudo su (so I am root)
(getlogin() ne "root") && die "$0 must be run by root!\n";
Apparently a better option is ($> ne 0) && die "$0 must be run by root!\n"; courtesy of http://stackoverflow.com/questions/5280517/how-can-i-check-for-root-when-a-user-runs-a-perl-script
($> ne 0) && die "$0 must be run by root!\n";
Fixed! I pushed an update... Tx for the notification!
(getlogin() ne "root") && die "$0 must be run by root!\n";
Doesn't seem to like sudo or even sudo su (so I am root)Apparently a better option is
($> ne 0) && die "$0 must be run by root!\n";
courtesy of http://stackoverflow.com/questions/5280517/how-can-i-check-for-root-when-a-user-runs-a-perl-script