Created
February 17, 2012 00:17
-
-
Save nanasess/1849100 to your computer and use it in GitHub Desktop.
Easy copy protection for perl.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Digest::SHA1 qw(sha1 sha1_hex sha1_base64); | |
my $document_root = $ENV{'DOCUMENT_ROOT'}; | |
my $addr = $ENV{'SERVER_ADDR'}; | |
my $v = sha1_hex($document_root,$addr); | |
if ($v ne '01f9ee68866f973e95c6c379afa9ab6e4a7a4395') { | |
print "Content-type: text/plain\n\n"; | |
print "hehehe\n"; | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment