File: //scripts.20110531.215904.25158/unblockip
#!/usr/bin/perl
# cpanel4 - scripts Copyright(c) 1997-2002 cPanel, Inc..
# All rights Reserved.
# copyright@cpanel.net http://cpanel.net
# This code is subject to the cpanel license. Unauthorized copying is prohibited
print "What ip do you want to unblock? ";
$ip = <STDIN>;
$ip =~ s/\n//g;
open(HA,"/etc/hosts.deny");
@HA=<HA>;
close(HA);
open(HA,">/etc/hosts.deny");
foreach $line (@HA) {
if ($line !~ / ${ip}$/){
print HA $line;
}
}
close(HA);
system("/sbin/route del -host $ip");