parent
c793cdef93
commit
9649dd4222
2 changed files with 39 additions and 0 deletions
@ -0,0 +1,34 @@ |
||||
#!/usr/bin/perl -w |
||||
|
||||
use strict; |
||||
use warnings; |
||||
use esmith::AccountsDB; |
||||
use File::Path qw(make_path remove_tree); |
||||
|
||||
my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database\n"; |
||||
|
||||
my $event = shift; |
||||
my $pool = shift; |
||||
|
||||
die "Misssing pool name argument" unless $pool; |
||||
|
||||
my $acc = $a->get($pool); |
||||
|
||||
die "$pool not found in the account database\n" unless $acc; |
||||
|
||||
my $dyn = $acc->prop('DynamicContent') || 'disabled'; |
||||
|
||||
if ($acc =~ m/^enabled|on|1|yes$/){ |
||||
make_path( qw( /var/log/php/$pool |
||||
/var/lib/php/$pool/session |
||||
/var/lib/php/$pool/wsdlcache |
||||
/var/lib/php/$pool/opcache |
||||
/var/lib/php/$pool/tmp ), { |
||||
chmode => 0770, |
||||
owner => 'root', |
||||
group => 'www' |
||||
}); |
||||
} |
||||
else{ |
||||
remote_tree( qw(/var/log/php/$pool /var/lib/php/$pool/) ); |
||||
} |
Loading…
Reference in new issue