Download update index if not available

This commit is contained in:
Daniel 2019-07-16 13:25:39 +02:00
parent 2bc0da6700
commit f3b5cb89ce
2 changed files with 8 additions and 2 deletions

View file

@ -31,7 +31,7 @@ func init() {
func main() {
// Set Info
info.Set("Portmaster", "0.3.1", "AGPLv3", true)
info.Set("Portmaster", "0.3.2", "AGPLv3", true)
// Start
err := modules.Start()

View file

@ -61,7 +61,13 @@ func start() error {
err = LoadIndexes()
if err != nil {
if os.IsNotExist(err) {
log.Infof("updates: stable.json does not yet exist, waiting for first update cycle")
// download indexes
log.Infof("updates: downloading update index...")
err = UpdateIndexes()
if err != nil {
return err
}
} else {
return err
}