Create instance directories as part of the config

PyroScope Project
2017-03-24 23:04:17 +01:00
parent 7942962bdf
commit 0457912bad
+9 -11
@@ -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