From e642983b882e221bee75bb19e1d0d0ceabe5aa7a Mon Sep 17 00:00:00 2001 From: Owen Date: Sun, 22 Jun 2025 12:10:00 -0400 Subject: [PATCH] Move updates --- main.go | 3 ++- updates.go => updates/updates.go | 2 +- util.go | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) rename updates.go => updates/updates.go (99%) diff --git a/main.go b/main.go index 2be8a83..a93a30a 100644 --- a/main.go +++ b/main.go @@ -17,6 +17,7 @@ import ( "github.com/fosrl/newt/docker" "github.com/fosrl/newt/logger" "github.com/fosrl/newt/proxy" + "github.com/fosrl/newt/updates" "github.com/fosrl/newt/websocket" "github.com/fosrl/newt/wg" "github.com/fosrl/newt/wgtester" @@ -192,7 +193,7 @@ func main() { logger.Info("Newt version " + newtVersion) } - if err := CheckForUpdate("fosrl", "newt", newtVersion); err != nil { + if err := updates.CheckForUpdate("fosrl", "newt", newtVersion); err != nil { logger.Error("Error checking for updates: %v\n", err) } diff --git a/updates.go b/updates/updates.go similarity index 99% rename from updates.go rename to updates/updates.go index ef5bbb5..8d7de5e 100644 --- a/updates.go +++ b/updates/updates.go @@ -1,4 +1,4 @@ -package main +package updates import ( "encoding/json" diff --git a/util.go b/util.go index a10c94f..6f09eb3 100644 --- a/util.go +++ b/util.go @@ -1,4 +1,4 @@ -package main +package util import ( "bytes" @@ -369,7 +369,7 @@ func updateTargets(pm *proxy.ProxyManager, action string, tunnelIP string, proto return nil } -func executeUpdownScript(action, proto, target string) (string, error) { +func executeUpdownScript(action, proto, target string, updownScript string) (string, error) { if updownScript == "" { return target, nil }