mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-25 13:29:27 +01:00
fix #622
This commit is contained in:
parent
542177213e
commit
04b25eb6bf
10
oragono.go
10
oragono.go
@ -39,6 +39,13 @@ func getPassword() string {
|
||||
return strings.TrimSpace(text)
|
||||
}
|
||||
|
||||
func fileDoesNotExist(file string) bool {
|
||||
if _, err := os.Stat(file); os.IsNotExist(err) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// implements the `oragono mkcerts` command
|
||||
func doMkcerts(configFile string, quiet bool) {
|
||||
config, err := irc.LoadRawConfig(configFile)
|
||||
@ -67,6 +74,9 @@ func doMkcerts(configFile string, quiet bool) {
|
||||
}
|
||||
host := config.Server.Name
|
||||
cert, key := conf.TLS.Cert, conf.TLS.Key
|
||||
if !(fileDoesNotExist(cert) && fileDoesNotExist(key)) {
|
||||
log.Fatalf("Preexisting TLS cert and/or key files: %s %s", cert, key)
|
||||
}
|
||||
err := mkcerts.CreateCert("Oragono", host, cert, key)
|
||||
if err == nil {
|
||||
if !quiet {
|
||||
|
Loading…
Reference in New Issue
Block a user