perl <<'EOF'
$domain = "domain_placeholder";
$userinfo = `egrep ^$domain:.+\$ /etc/userdomains | cut -d: -f2`;
chomp($userinfo);
$userinfo =~ s/^\s+//;
if ( $userinfo eq "" ) {
        print "[*] Couldn't find this user. Aborting.\n";
        exit;
}
@suspendedusers = </var/cpanel/suspended/*>;
foreach (@suspendedusers) {
        if ( $_ !~ /^.*\.lock$/ ) {
                (undef,undef,undef,undef,$suspuser) = split('/', $_);
                if ( $userinfo eq $suspuser ) {
                        print "[*] This user is suspended. Aborting.\n";
                        exit;
                }
        }
}
print "\n[*] Checking for fantastico lock file.\n";
if ( -e "/home/$userinfo/.fantasticodata/installed_in_root.php" ) {
    print "[*] Looking for installation in public_html.\n";
    foreach my $file ( `find /home/$userinfo/.fantasticodata/ -name \\*\\|\\*`) {
        chomp($file);
        open(my $DAT, '<', $file);
            while(<$DAT>) {
                if ( /\$thisscriptpath\s=\s\"\/home\/$userinfo\/public_html\"/ ) {
                    die "[!] Active install found in public_html! Aborting!\n";
                }
            }
        close($DAT);
    }
    unlink("/home/$userinfo/.fantasticodata/installed_in_root.php");
    print "[*] Fantastico lock file removed successfully.\n";
} else {
    print "[*] No fantastico lock file found.\n";
}

EOF
