mirror of
https://github.com/fiatjaf/nak.git
synced 2024-11-22 16:19:07 -05:00
print bunker restart command without schemes in relay urls when possible.
This commit is contained in:
parent
262c0c892a
commit
1ba39ca7d7
11
bunker.go
11
bunker.go
|
@ -115,10 +115,19 @@ var bunker = &cli.Command{
|
||||||
secretKeyFlag = "--sec " + sec
|
secretKeyFlag = "--sec " + sec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
relayURLsPossiblyWithoutSchema := make([]string, len(relayURLs))
|
||||||
|
for i, url := range relayURLs {
|
||||||
|
if strings.HasPrefix(url, "wss://") {
|
||||||
|
relayURLsPossiblyWithoutSchema[i] = url[6:]
|
||||||
|
} else {
|
||||||
|
relayURLsPossiblyWithoutSchema[i] = url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
restartCommand := fmt.Sprintf("nak bunker %s%s %s",
|
restartCommand := fmt.Sprintf("nak bunker %s%s %s",
|
||||||
secretKeyFlag,
|
secretKeyFlag,
|
||||||
preauthorizedFlags,
|
preauthorizedFlags,
|
||||||
strings.Join(relayURLs, " "),
|
strings.Join(relayURLsPossiblyWithoutSchema, " "),
|
||||||
)
|
)
|
||||||
|
|
||||||
log("listening at %v:\n pubkey: %s \n npub: %s%s%s\n to restart: %s\n bunker: %s\n\n",
|
log("listening at %v:\n pubkey: %s \n npub: %s%s%s\n to restart: %s\n bunker: %s\n\n",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user