我不知道如何在命令执行后将shell脚本的输出返回到rtorrent。有没有可能将exeternal命令的输出返回到rtorrent会话?我使用rtorrent脚本接口在torrent完成后自动执行外壳命令,.rtorrent.rc中的事件行如下所示:
system.method.set_key = event.download.finished,mycustomcommand,"execute=~/myshellscript.sh"myshellscript.sh文件如下所示
#!/bin/sh
echo "Torrent finished!"有没有办法做到这一点?
发布于 2013-11-12 03:39:44
我不知道你在找什么,但我在rtorrent's wiki site上找到了这个
execute_capture_nothrow={command,arg1,arg2,...}
这将执行带有参数arg1,arg2,....的外部命令。它将返回命令的标准输出。
发布于 2014-03-19 08:35:56
system.method.set_key = event.download.finished,mycustomcommand,print="$execute_capture=/path/to/script" 至少应该行得通
print="$execute_capture=/path/to/script"当你在rtorrent中做这件事的时候起作用。如果您想要存储输出,那么使用d.custom1.set=代替打印,如果这有帮助的话。
发布于 2021-03-13 20:21:40
根据我的说法,您忘记向rtorrent.rc本身添加参数,而且bash脚本也不完整。
.rtorrent.rc行应该有
method.set_key = event.download.finished,whatever,"execute2={/path/myscript.sh,$d.name=,$d.base_path=,$d.hash=}"bash脚本
#!/bin/bash
TORRENT_NAME=1
TORRENT_PATH=2
TORRENT_HASH=3
touch "$1" Finished download!
exit这将创建触摸文件,告诉您特定的文件已完成下载。
https://stackoverflow.com/questions/19914250
复制相似问题