carelburger
February 26th, 2011, 02:19 PM
Hi,
I have a bash script that I wrote and it calls flexget which then give an output like this:
2011-02-26 15:11 INFO feed MyTracker Produced 1 entries.
2011-02-26 15:11 INFO feed MyTracker Accepted: 1 (Rejected: 0 Undecided: 0 Failed: 0)
2011-02-26 15:11 INFO download MyTracker Downloading: Test
2011-02-26 15:11 INFO modify_trackers MyTracker Added http://test.net/announce.php?passkey=714c390d9916a735964c0a7ba7b6a a3d tracker to Test
2011-02-26 15:11 INFO deluge MyTracker Connecting to daemon at localhost:58846..
2011-02-26 15:11 INFO deluge MyTracker Connected to daemon at localhost:58846..
2011-02-26 15:11 INFO deluge MyTracker Test successfully added to deluge.
2011-02-26 15:11 INFO deluge MyTracker Connection lost to daemon at localhost:58846 reason: Connection was closed cleanly.
Ok so there it was successfull, but if not it would say failed.
The command looks like this:
flexget --feed=MyTracker --inject "$filename" "$HTTPDownloadLocation$filenameWithoutSpaces$Torren tExtension" --cli-config "path=$directory"
How can I pipe this output from flexget and look at the output and determine if it was successfull or a failure. I need to run different commands with a if statement depending on the success of the command.
I have a bash script that I wrote and it calls flexget which then give an output like this:
2011-02-26 15:11 INFO feed MyTracker Produced 1 entries.
2011-02-26 15:11 INFO feed MyTracker Accepted: 1 (Rejected: 0 Undecided: 0 Failed: 0)
2011-02-26 15:11 INFO download MyTracker Downloading: Test
2011-02-26 15:11 INFO modify_trackers MyTracker Added http://test.net/announce.php?passkey=714c390d9916a735964c0a7ba7b6a a3d tracker to Test
2011-02-26 15:11 INFO deluge MyTracker Connecting to daemon at localhost:58846..
2011-02-26 15:11 INFO deluge MyTracker Connected to daemon at localhost:58846..
2011-02-26 15:11 INFO deluge MyTracker Test successfully added to deluge.
2011-02-26 15:11 INFO deluge MyTracker Connection lost to daemon at localhost:58846 reason: Connection was closed cleanly.
Ok so there it was successfull, but if not it would say failed.
The command looks like this:
flexget --feed=MyTracker --inject "$filename" "$HTTPDownloadLocation$filenameWithoutSpaces$Torren tExtension" --cli-config "path=$directory"
How can I pipe this output from flexget and look at the output and determine if it was successfull or a failure. I need to run different commands with a if statement depending on the success of the command.