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";
open(DAT, "/etc/localdomains");
@ldomains = <DAT>;
close(DAT);
open(DAT, "/etc/remotedomains");
@rdomains = <DAT>;
close(DAT);
if (grep(/^$domain$/,@ldomains)) {
        print "[*] $domain is currently in localdomains\n";
        exit;
}

if (grep(/^$domain$/,@rdomains)) {
        print "[*] $domain is currently in remotedomains\n";
        exit;
}

print "[*] $domain is not located in either file. An Admin will need to investigate. Please create a ticket for the customer.\n";
EOF
