From 0457912bad1afce9ada8d6b4dc9fe9f41d1755cb Mon Sep 17 00:00:00 2001 From: PyroScope Project Date: Fri, 24 Mar 2017 23:04:17 +0100 Subject: [PATCH] Create instance directories as part of the config --- CONFIG-Template.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/CONFIG-Template.md b/CONFIG-Template.md index ad00c0f..bbfa93f 100644 --- a/CONFIG-Template.md +++ b/CONFIG-Template.md @@ -16,22 +16,16 @@ use-cases in the appropriate sections of the wiki, like the ## Using the Template -To create the directory tree this configuration expects, use these commands: - -```sh -basedir="$HOME/rtorrent" -mkdir -p "$basedir"/{.session,download,log,watch/load,watch/start} -``` - -The `basedir` value has to be the same you set in `cfg.basedir` below. - Use this command to get a copy of the template to your disk: ```sh -curl -Ls https://raw.githubusercontent.com/wiki/rakshasa/rtorrent/CONFIG-Template.md \ - | grep -A9999 '^######' | grep -B9999 '^### END' >~/.rtorrent.rc +curl -Ls "https://raw.githubusercontent.com/wiki/rakshasa/rtorrent/CONFIG-Template.md" \ + | grep -A9999 '^######' | grep -B9999 '^### END' \ + | sed -re "s:/home/USERNAME:$HOME:" >~/.rtorrent.rc ``` +Then (re-)start rTorrent. + ## The Template :construction: | This is NOT complete yet! @@ -52,6 +46,10 @@ method.insert = cfg.watch, private|const|string, (cat,(cfg.basedir),"watch/ method.insert = cfg.logs, private|const|string, (cat,(cfg.basedir),"log/") method.insert = cfg.logfile, private|const|string, (cat,(cfg.logs),"rtorrent-",(system.time),".log") +# Create instance directories +execute.throw = bash, -c, (cat,\ + "mkdir -p \"", (cfg.basedir), "\"{.session,download,log,watch/load,watch/start}") + # Listening port for incoming peer traffic (fixed; you can also randomize it) network.port_range.set = 50000-50000 network.port_random.set = no