HEX
Server: Apache
System: Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User: u103727277 (3416564)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: //usr/lib/susshi/exec/quota
#!/usr/bin/perl

use warnings;
use strict;

use lib '/usr/lib/susshi/exec';
use Susshi;

use Quota;

my $home=(getpwuid($<))[7]
    or error_die "Cannot find homedir for uid=$<";
my $qcarg=Quota::getqcarg($home)
    or error_die "Quota::getqcarg: $home: " . Quota::strerr();
my @quota=Quota::query($qcarg)
    or error_die "Quota::query: $qcarg: " . Quota::strerr();

my %hash = (
    diskquota    => $quota[0],
    diskquotamax => $quota[1],
    filequota    => $quota[4],
    filequotamax => $quota[5],
);

info("quota for $<: $quota[0]/$quota[1] blocks, $quota[4]/$quota[5] files");

send_json_output(\%hash);