parse host as FQDN or IP

This commit is contained in:
wish
2022-08-04 23:52:13 +10:00
parent a7ec76f865
commit e9cc5cc3e2
6 changed files with 23 additions and 9 deletions

View File

@@ -9,8 +9,8 @@ import (
// Config holds the global server-wide config.
type Config struct {
HostIP string `mapstructure:"host_ip"`
BinPath string `mapstructure:"bin_path"`
Host string `mapstructure:"Host"`
BinPath string `mapstructure:"BinPath"`
DisableSoftCrash bool // Disables the 'Press Return to exit' dialog allowing scripts to reboot the server automatically
DevMode bool
@@ -140,8 +140,8 @@ func LoadConfig() (*Config, error) {
return nil, err
}
if c.HostIP == "" {
c.HostIP = getOutboundIP4().To4().String()
if c.Host == "" {
c.Host = getOutboundIP4().To4().String()
}
return c, nil