Skip to content

Instantly share code, notes, and snippets.

@angeloxx
Last active July 24, 2016 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angeloxx/81ad7b4fef730cbb51d70a0d08971b35 to your computer and use it in GitHub Desktop.
Save angeloxx/81ad7b4fef730cbb51d70a0d08971b35 to your computer and use it in GitHub Desktop.
RTgui start/stop all rtorrent downloads
--- control.php.old 2016-07-24 15:55:48.052000000 +0200
+++ control.php 2016-07-24 15:35:04.992000000 +0200
@@ -116,6 +116,12 @@
case "delete":
$response = do_xmlrpc(xmlrpc_encode_request("d.erase",array("$r_hash")));
break;
+ case "startall":
+ $response = do_xmlrpc(xmlrpc_encode_request("d.multicall",array("","d.start=")));
+ break;
+ case "stopall":
+ $response = do_xmlrpc(xmlrpc_encode_request("d.multicall",array("","d.stop=")));
+ break;
case "hashcheck":
$response = do_xmlrpc(xmlrpc_encode_request("d.check_hash",array("$r_hash")));
break;

This snippet adds the stopall/startall command to RTgui, you can call it via http://hostname/control.php?cmd=startall GET request and integrate it, like me, the Torrent download with the home automation system (ie VantageControls InFusion system via UselessAngelo.Generic HTTP Client driver). In this way I stop the BitTorrent client when I power on the TV set and restart it when power off the TV or arm the burgalarm system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment