HEX
Server: Apache
System: Linux infong-uk86 4.4.400-icpu-106 #2 SMP Mon Sep 15 08:23:40 UTC 2025 x86_64
User: u44115835 (4976590)
PHP: 8.4.17
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;