Changes between Version 5 and Version 6 of Scripts/Watchdog


Ignore:
Timestamp:
Dec 16, 2008, 11:27:02 PM (12 years ago)
Author:
Waldorf
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Scripts/Watchdog

    v5 v6  
    2020movesubdir="added/"
    2121
     22# Authentication "username:password":
     23#tr_auth="admin:admin"
     24
     25# Transmission host:
     26tr_host="127.0.0.1:9091"
     27
    2228# Verbose?
    2329verbose=1
     30
     31#############################################
     32time=$(date "+%Y-%m-%d (%H:%M:%S)")
     33if [ -n "$tr_auth" ]; then
     34    tr_auth="--auth=$tr_auth"
     35fi
    2436
    2537for file in "$watchdir"*.torrent
    2638do
    2739    if [ -f "$file" ]; then
    28         if [ $verbose ]; then echo "$file added to queue."; fi
     40        if [ -n "$verbose" ]; then echo "$time: $file added to queue."; fi
    2941
    30         if [ $tr_auth ]; then
    31             /usr/local/bin/transmission-remote --auth="$tr_auth" -a "$file" > /dev/null
    32         else
    33             /usr/local/bin/transmission-remote -a "$file" > /dev/null
    34         fi
    35        
     42        /usr/local/bin/transmission-remote "$tr_host" "$tr_auth" -a "$file" > /dev/null
    3643        # give the remote some time to process
    3744        sleep 5
     
    4855        fi
    4956    else
    50         if [ $verbose ]; then echo "No torrent in $watchdir."; fi
     57        if [ -n "$verbose" ]; then echo "$time: No torrent in $watchdir."; fi
    5158    fi
    5259done