Don't try to create or delete scan dir if no user has been passed

tags/ipasserelle-base-0.2.69-1
Daniel Berteaud 6 years ago
parent e15950284b
commit a3bfaa2126
  1. 4
      root/etc/e-smith/events/actions/share-modify-scan

@ -14,7 +14,7 @@ my $name = $ARGV [1];
die "Event name missing\n" unless (defined $event); die "Event name missing\n" unless (defined $event);
if ($event eq 'user-create'){ if ($event eq 'user-create' and defined $name){
mkpath "/home/e-smith/files/scan/$name"; mkpath "/home/e-smith/files/scan/$name";
system ("$setfacl", system ("$setfacl",
'-m', '-m',
@ -22,7 +22,7 @@ if ($event eq 'user-create'){
'--', '--',
"/home/e-smith/files/scan/$name"); "/home/e-smith/files/scan/$name");
} }
elsif ($event eq 'user-delete'){ elsif ($event eq 'user-delete' and defined $name){
rmtree "/home/e-smith/files/scan/$name"; rmtree "/home/e-smith/files/scan/$name";
} }
else { else {

Loading…
Cancel
Save