mirror of
https://github.com/fosrl/newt.git
synced 2026-02-27 23:36:41 +00: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/docker"
|
||||||
"github.com/fosrl/newt/logger"
|
"github.com/fosrl/newt/logger"
|
||||||
"github.com/fosrl/newt/proxy"
|
"github.com/fosrl/newt/proxy"
|
||||||
|
"github.com/fosrl/newt/updates"
|
||||||
"github.com/fosrl/newt/websocket"
|
"github.com/fosrl/newt/websocket"
|
||||||
"github.com/fosrl/newt/wg"
|
"github.com/fosrl/newt/wg"
|
||||||
"github.com/fosrl/newt/wgtester"
|
"github.com/fosrl/newt/wgtester"
|
||||||
@@ -192,7 +193,7 @@ func main() {
|
|||||||
logger.Info("Newt version " + newtVersion)
|
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)
|
logger.Error("Error checking for updates: %v\n", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package main
|
package updates
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
4
util.go
4
util.go
@@ -1,4 +1,4 @@
|
|||||||
package main
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@@ -369,7 +369,7 @@ func updateTargets(pm *proxy.ProxyManager, action string, tunnelIP string, proto
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func executeUpdownScript(action, proto, target string) (string, error) {
|
func executeUpdownScript(action, proto, target string, updownScript string) (string, error) {
|
||||||
if updownScript == "" {
|
if updownScript == "" {
|
||||||
return target, nil
|
return target, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user