aMule Forum
English => aMule Help => Topic started by: Syphon on July 03, 2010, 12:15:07 PM
-
Hi Guys!
I've a got a problem about downloaded file permissions. I use amule daemon so I have to configure the amule.conf. I found i can set amule to auto run a command or a shell script after the "download completed event" by enabling "CoreEnabled".
So I Wrote:
CoreEnabled = 1
CoreCommand = permissions.sh "%FILE"
The script is:
#!/bin/bash
chmod 770 $1
chown user:group $1
$1 should refers to "%FILE" arg,but it doesn't work!
Logfile says is impossible to run "permission.sh".
Where's the mistake?
Any help would be very appreciated..
P.s. permission.sh is in the same directory of amule.conf. and it's chmodded 777.
P.p.s. Everything works ok if I write just a single command in the "CoreCommand" section,i.e. chmod 770 "%FILE".
-
Logfile says is impossible to run "permission.sh".
Where's the mistake?
The command (script, in your case) must be accessible via the PATH setting of the amule(d) process, or it should contain the full (absolute) pathname to run.
So, in your case you'd probably want to write something like
CoreCommand = /home/amuled_user/.aMule/permissions.sh "%FILE"
Please note, that amuled does not chdir() to the directory containing amule.conf (in which case you should have written ./permissions.sh), nor does it any black magic to find out where your executable lies. That's left to the operating system.
-
Thank You for The Answer!
I modified the amule.conf:
CoreCommand: sh -c '/home/amuled_user/.aMule/permissions.sh "%FILE"'
I modified the shell script, otherwise it doesn't work with filename with spaces.
#!/bin/bash
chmod 755 "$1"
chown user:group "$1"
Now it's perfect!
Thank you so much for your support!
Best regards
Syphon