Exit on permission denied
This commit is contained in:
parent
f37349fff7
commit
81af7ab264
2 changed files with 16 additions and 4 deletions
10
traefik.go
10
traefik.go
|
@ -168,9 +168,15 @@ func main() {
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
if len(gloablConfiguration.CertFile) > 0 && len(gloablConfiguration.KeyFile) > 0 {
|
if len(gloablConfiguration.CertFile) > 0 && len(gloablConfiguration.KeyFile) > 0 {
|
||||||
srv.ListenAndServeTLS(gloablConfiguration.CertFile, gloablConfiguration.KeyFile)
|
err := srv.ListenAndServeTLS(gloablConfiguration.CertFile, gloablConfiguration.KeyFile)
|
||||||
|
if (err!= nil ){
|
||||||
|
log.Fatal("Error creating server: ", err)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
srv.ListenAndServe()
|
err := srv.ListenAndServe()
|
||||||
|
if (err!= nil ){
|
||||||
|
log.Fatal("Error creating server: ", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
log.Notice("Started")
|
log.Notice("Started")
|
||||||
|
|
10
web.go
10
web.go
|
@ -46,9 +46,15 @@ func (provider *WebProvider) Provide(configurationChan chan<- *Configuration) {
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
if len(provider.CertFile) > 0 && len(provider.KeyFile) > 0 {
|
if len(provider.CertFile) > 0 && len(provider.KeyFile) > 0 {
|
||||||
http.ListenAndServeTLS(provider.Address,provider.CertFile, provider.KeyFile, systemRouter)
|
err := http.ListenAndServeTLS(provider.Address,provider.CertFile, provider.KeyFile, systemRouter)
|
||||||
|
if (err!= nil ){
|
||||||
|
log.Fatal("Error creating server: ", err)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
http.ListenAndServe(provider.Address, systemRouter)
|
err := http.ListenAndServe(provider.Address, systemRouter)
|
||||||
|
if (err!= nil ){
|
||||||
|
log.Fatal("Error creating server: ", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue