Fix share-modify-scan script

tags/ipasserelle-base-0.2.65-1
Daniel Berteaud 12 years ago
parent ec44fedb63
commit c9ac1c41f9
  1. 12
      root/etc/e-smith/events/actions/share-modify-scan

@ -12,6 +12,8 @@ my $setfacl = "/usr/bin/setfacl";
my $event = $ARGV [0];
my $name = $ARGV [1];
die "Event name missing\n" unless (defined $event);
if ($event eq 'user-create'){
mkpath "/home/e-smith/files/scan/$name";
system ("$setfacl",
@ -32,9 +34,13 @@ else {
"/home/e-smith/files/scan/");
foreach ($a->users,$a->get('admin')){
my $name = $_->key;
mkdir "/home/e-smith/files/scan/$name", 0700
unless (-d "/home/e-smith/files/scan/$name");
$name = $_->key;
if (-d "/home/e-smith/files/scan/$name"){
chmod 0700, "/home/e-smith/files/scan/$name";
}
else {
mkdir "/home/e-smith/files/scan/$name", 0700;
}
system ("$setfacl",
'-m',
"u:scanner:rwX,u:$name:rwX,d:u:$name:rwX",

Loading…
Cancel
Save