2020-02-26 19:02:18 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Get the number of torrents, begins from 2 (1 is header line), the last
|
|
|
|
# line is SUM.
|
2023-05-18 11:25:47 +02:00
|
|
|
TORRENTS=$(transmission-remote -l | wc -l)
|
2020-02-26 19:02:18 +01:00
|
|
|
CURRENT=1
|
|
|
|
|
|
|
|
# until $CURRENT equals $TORRENTS ?
|
2023-05-18 11:25:47 +02:00
|
|
|
until [ $CURRENT -gt $TORRENTS ]; do
|
2023-04-06 11:03:10 +02:00
|
|
|
# get the information for $CURRENT? Grep the magnet line and cut out the
|
|
|
|
# frist field ("Magnet: ") using awk?
|
|
|
|
transmission-remote -l -t $CURRENT -i | grep -i magnet | awk -F': ' '{print $2}'
|
|
|
|
# increase $CURRENT
|
|
|
|
((CURRENT++))
|
2020-02-26 19:02:18 +01:00
|
|
|
done
|