mirror of
https://github.com/fosrl/newt.git
synced 2025-12-05 19:17:38 -06:00
Move updates
This commit is contained in:
3
main.go
3
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)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package updates
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
4
util.go
4
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user