summaryrefslogtreecommitdiffstats
path: root/drop.sh
blob: 8519e198c073059d78079a59bdff9a838e819828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
#----------------------------------------------------
# Author:       Florian "Bluewind" Pritz <flo@xssn.at>
#
# Licensed under WTFPL v2
#   (see COPYING for full license text)
#    
#----------------------------------------------------
# called by incrond to manage ~/drop
#----------------------------------------------------
for file; do
  case $(file -b --mime-type "$file") in
  application/x-bittorrent)
    chmod 644 "$file"
    mv "$file" /mnt/mistral/flo/torrent/watch
    transmission-remote mistral:9091 -a "/mnt/mistral/flo/torrent/watch/$(basename "$file")"
  ;;
  *)
    # nothing
  ;;
  esac
done