aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Core command...  (Read 4285 times)

michelinok

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 92
Core command...
« on: February 06, 2011, 06:20:54 PM »

Hi!
I've set this command

echo %NAME >> /hddext/filesharingscaricati.txt

on downoad completed, but it never write anything to the file.
What am i wrong? (/hddext exists of course!).
Logged
------------------------------------------------------------------
Pump up my karma :P, i'm running amule on an ARM9!
------------------------------------------------------------------

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Core command...
« Reply #1 on: February 06, 2011, 08:25:05 PM »

You have to name an executable, not a shell command. For that you have to name the shell to be executed.
Just putting your line in an executable shell script and using that should work.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: Core command...
« Reply #2 on: February 07, 2011, 12:30:35 AM »

Also see

Code: [Select]
sh -c "echo %NAME >> ...."
Logged

michelinok

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 92
Re: Core command...
« Reply #3 on: February 08, 2011, 08:05:08 AM »

Should this work?


#!/bin/bash
echo "$1" >> /hddext/filesharingscaricati.txt


it doesn't work at all...(i call it with the name of the script followed by %NAME)
Logged
------------------------------------------------------------------
Pump up my karma :P, i'm running amule on an ARM9!
------------------------------------------------------------------

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Core command...
« Reply #4 on: February 08, 2011, 09:42:46 AM »

Did you chmod 700 the script and chown it to the user that runs aMule?
Logged

michelinok

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 92
Re: Core command...
« Reply #5 on: February 08, 2011, 12:48:28 PM »

Did you chmod 700 the script and chown it to the user that runs aMule?

yes, chmod'ed and tryed it from the command line...and from the command line it works.
Any idea?
Logged
------------------------------------------------------------------
Pump up my karma :P, i'm running amule on an ARM9!
------------------------------------------------------------------

michelinok

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 92
Re: Core command...
« Reply #6 on: February 09, 2011, 09:31:55 PM »

anyone can help me?  ::)
Logged
------------------------------------------------------------------
Pump up my karma :P, i'm running amule on an ARM9!
------------------------------------------------------------------

^marcell^

  • Developer
  • Hero Member
  • *****
  • Karma: 28
  • Offline Offline
  • Posts: 524
Re: Core command...
« Reply #7 on: February 09, 2011, 10:43:34 PM »

Should this work?


#!/bin/bash
echo "$1" >> /hddext/filesharingscaricati.txt


it doesn't work at all...(i call it with the name of the script followed by %NAME)

You have to add the full path to the script, not only the name of the script.
Logged

michelinok

  • Jr. Member
  • **
  • Karma: 2
  • Offline Offline
  • Posts: 92
Re: Core command...
« Reply #8 on: February 11, 2011, 07:00:57 PM »

Should this work?


#!/bin/bash
echo "$1" >> /hddext/filesharingscaricati.txt


it doesn't work at all...(i call it with the name of the script followed by %NAME)

You have to add the full path to the script, not only the name of the script.

yes, this is what i've done:

sh /bin/scrivi.sh %NAME

anyway  "scrivi.sh" is in the path and works anywhere in my filesystem.
I've no idea now  :-[ :-[ :'(
Logged
------------------------------------------------------------------
Pump up my karma :P, i'm running amule on an ARM9!
------------------------------------------------------------------

^marcell^

  • Developer
  • Hero Member
  • *****
  • Karma: 28
  • Offline Offline
  • Posts: 524
Re: Core command...
« Reply #9 on: February 12, 2011, 07:54:46 PM »

Do you run aMule with the same user that you execute the script in the terminal?

I tested the core command for completed downloads with a script located in my home directory. It worked.
I would suggest to copy the script to a different location. Scripts shouldn't be stored in the "/bin" directory.
Perhaps try to store it in the home folder and run aMule with the user who's home folder it is located in.
Logged