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: //kunden/lib/susshi/exec/stage-delete
#!/usr/bin/perl

use warnings;
use strict;

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

use IPC::Run qw( run timeout );

my $susshi = Susshi->new ( -read_input => 1 );

my $dir    = $susshi->get_directory('directory', -mandatory => 1, -must_exist => 1);

# Make sure the directory is writeable (ITOSHL-8155)
chmod(0755, $dir) or error_die "Could not set u+w to $dir: $!";
info "Set chmod 0755 for $dir";

my $cmd=[ 'rm', '-rf', $dir ];

eval {
    my $err='';
    run $cmd, '2>', \$err or die;
};
error_die "Could not remove $dir: $@" if $@;

info "Deleted stage directory $dir";

exit 0;