diff --git a/lib/runtime/config.example.yml b/lib/runtime/config.example.yml index 44940952..82dd11f5 100644 --- a/lib/runtime/config.example.yml +++ b/lib/runtime/config.example.yml @@ -19,4 +19,6 @@ restful: host: "127.0.0.1" port: 7331 # `enable: true` means starting RESTful Server when Platypus starts. - enable: true \ No newline at end of file + enable: true +# Check new releases from GitHub when starting Platypus +update: true \ No newline at end of file diff --git a/platypus.go b/platypus.go index a16e44fb..02b96440 100644 --- a/platypus.go +++ b/platypus.go @@ -25,12 +25,10 @@ type Config struct { Port int16 `yaml:"port"` Enable bool `yaml:"enable"` } + Update bool } func main() { - // Detect new version - update.ConfirmAndSelfUpdate() - // Detect and create config file configFilename := "config.yml" if !fs.FileExists(configFilename) { @@ -46,6 +44,11 @@ func main() { // Create context context.CreateContext() + // Detect new version + if config.Update { + update.ConfirmAndSelfUpdate() + } + // Init servers from config file for _, s := range config.Servers { server := context.CreateTCPServer(s.Host, uint16(s.Port), s.HashFormat)