Skip to content

Instantly share code, notes, and snippets.

@takus
Created May 7, 2012 01:22
Show Gist options
  • Save takus/2625288 to your computer and use it in GitHub Desktop.
Save takus/2625288 to your computer and use it in GitHub Desktop.
check executing as root
chomp(my $user = `/usr/bin/whoami`);
unless ($user eq 'root') {
print "cannot exec by $user user.\nyou can execute this script by root only.\n";
exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment