]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Ability to override fifos/ btrtrc-old
authorSergey Matveev <stargrave@stargrave.org>
Sun, 29 Jan 2023 09:25:31 +0000 (12:25 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 29 Jan 2023 09:25:45 +0000 (12:25 +0300)
cmd/btrtrc/fifos.go
cmd/btrtrc/main.go

index 0167b7342f1ab25adb52df5472f3d9979a96e66e..c723be04ff73dfcd269ce0e8ab958fec1422e923 100644 (file)
@@ -25,7 +25,6 @@ import (
 
 const (
        MaxListNameWidth = 40
-       FIFOsDir         = "fifos"
        PeersDir         = "peers"
        FilesDir         = "files"
 )
@@ -37,6 +36,7 @@ type TorrentStat struct {
 }
 
 var (
+       FIFOsDir      = "fifos"
        TorrentStats  = map[metainfo.Hash]TorrentStat{}
        TorrentStatsM sync.RWMutex
        Torrents      []metainfo.Hash
index 63e6c4fff24a18c9c4e0d2cba14ad5019eae61d6..96d9c3fbcbb3d03f19cda4ef77d1b1d773fa7ddf 100644 (file)
@@ -26,6 +26,7 @@ var (
 
 func main() {
        log.SetFlags(log.Ldate | log.Ltime)
+       fifosDir := flag.String("fifos", "fifos", "Path to fifos/")
        dhtBoot := flag.String("dht", "dht.cypherpunks.ru:8991", "Comma-separated list of DHT bootstrap nodes")
        addr := flag.String("bind", "[::]:6881", "Address to bind to")
        pub4 := flag.String("4", "", "External IPv4 address")
@@ -35,6 +36,7 @@ func main() {
        verify := flag.Bool("verify", false, "Force verification of provided torrents")
        flag.Parse()
 
+       FIFOsDir = *fifosDir
        dht.DefaultGlobalBootstrapHostPorts = strings.Split(*dhtBoot, ",")
        cc := torrent.NewDefaultClientConfig()
        cc.Debug = *debug