perl <<'EOF'
use strict;
use warnings;

my $domain = 'domain_placeholder';
chomp(my $user = `egrep ^$domain:.+\$ /etc/userdomains | cut -d: -f2`);
$user =~ s/^\s+//;

if ( ! $user ) {
	die("[!] Unable to find user for specified domain!");
}

my $home;
foreach ('home1', 'home2', 'home3', 'home4') {
    if ( -d "/$_/$user" ) {
        $home = $_;
    }
}
$home = 'home' unless $home;

chomp(my $ncdu = `which ncdu`);

if ((! $ncdu) && ( ! -x '/root/bin/ncdu' )) {
	die("[!] Unable to run this command, required dependency (ncdu) is not installed! Will need to check manually\n")
}

system("$ncdu -q -rr /$home/$user");
EOF