Menu

#281 on-download-complete script doesnt get all three parameters

Undecided
open
nobody
None
5
2012-09-29
2012-05-06
Anonymous
No
1
2
3
4
5
6
7
8
#!/bin/sh
BASE_DIR=/home/scripts/download_manager
WORK_DIR=${BASE_DIR}/work
OUTPUT_DIR=${BASE_DIR}/output

FILENAME=$3
echo "Called with [$1] [$2] [$3]" >${BASE_DIR}/debug.txt
mv ${FILENAME} ${OUTPUT_DIR}/

=====================================================================

Command executed:
aria2c --on-download-complete=completed.ksh -i urls.txt

=====================================================================
Problem: completed.ksh is being called. But it has value only for $1

Discussion

  • tujikawa

    tujikawa - 2012-05-07

    Works for me.
    Which version of aria2?

    Also check the log file (-l option) which contains the 3 arguments to be sent to the script like this:

    INFO - [util.cc:1502]Executing user command: hook.sh 1 1 index.html

     
  • tujikawa

    tujikawa - 2012-09-29
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,11 +1,11 @@
    -#!/bin/sh
    -BASE_DIR=/home/scripts/download_manager
    -WORK_DIR=${BASE_DIR}/work
    -OUTPUT_DIR=${BASE_DIR}/output
    -
    -FILENAME=$3
    -echo "Called with [$1] [$2] [$3]" >${BASE_DIR}/debug.txt
    -mv ${FILENAME} ${OUTPUT_DIR}/
    
    +    #!/bin/sh
    +    BASE_DIR=/home/scripts/download_manager
    +    WORK_DIR=${BASE_DIR}/work
    +    OUTPUT_DIR=${BASE_DIR}/output
    +    
    +    FILENAME=$3
    +    echo "Called with [$1] [$2] [$3]" >${BASE_DIR}/debug.txt
    +    mv ${FILENAME} ${OUTPUT_DIR}/
     =====================================================================
    
     Command executed:
    
    • milestone: 1.2.x_(Linux) --> Undecided
     

Log in to post a comment.

MongoDB Logo MongoDB