mirror of
https://github.com/fosrl/newt.git
synced 2026-03-07 19:26:41 +00:00
Change rm to keep
This commit is contained in:
2
linux.go
2
linux.go
@@ -45,7 +45,7 @@ func setupClients(client *websocket.Client) {
|
|||||||
|
|
||||||
func closeClients() {
|
func closeClients() {
|
||||||
if wgService != nil {
|
if wgService != nil {
|
||||||
wgService.Close(rm)
|
wgService.Close(!keepInterface)
|
||||||
wgService = nil
|
wgService = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
6
main.go
6
main.go
@@ -80,7 +80,7 @@ var (
|
|||||||
logLevel string
|
logLevel string
|
||||||
interfaceName string
|
interfaceName string
|
||||||
generateAndSaveKeyTo string
|
generateAndSaveKeyTo string
|
||||||
rm bool
|
keepInterface bool
|
||||||
acceptClients bool
|
acceptClients bool
|
||||||
updownScript string
|
updownScript string
|
||||||
tlsPrivateKey string
|
tlsPrivateKey string
|
||||||
@@ -106,7 +106,7 @@ func main() {
|
|||||||
updownScript = os.Getenv("UPDOWN_SCRIPT")
|
updownScript = os.Getenv("UPDOWN_SCRIPT")
|
||||||
interfaceName = os.Getenv("INTERFACE")
|
interfaceName = os.Getenv("INTERFACE")
|
||||||
generateAndSaveKeyTo = os.Getenv("GENERATE_AND_SAVE_KEY_TO")
|
generateAndSaveKeyTo = os.Getenv("GENERATE_AND_SAVE_KEY_TO")
|
||||||
rm = os.Getenv("RM") == "true"
|
keepInterface = os.Getenv("KEEP_INTERFACE") == "true"
|
||||||
acceptClients = os.Getenv("ACCEPT_CLIENTS") == "true"
|
acceptClients = os.Getenv("ACCEPT_CLIENTS") == "true"
|
||||||
tlsPrivateKey = os.Getenv("TLS_CLIENT_CERT")
|
tlsPrivateKey = os.Getenv("TLS_CLIENT_CERT")
|
||||||
dockerSocket = os.Getenv("DOCKER_SOCKET")
|
dockerSocket = os.Getenv("DOCKER_SOCKET")
|
||||||
@@ -142,7 +142,7 @@ func main() {
|
|||||||
if generateAndSaveKeyTo == "" {
|
if generateAndSaveKeyTo == "" {
|
||||||
flag.StringVar(&generateAndSaveKeyTo, "generateAndSaveKeyTo", "/tmp/newtkey", "Path to save generated private key")
|
flag.StringVar(&generateAndSaveKeyTo, "generateAndSaveKeyTo", "/tmp/newtkey", "Path to save generated private key")
|
||||||
}
|
}
|
||||||
flag.BoolVar(&rm, "rm", false, "Remove the WireGuard interface")
|
flag.BoolVar(&keepInterface, "keep-interface", false, "Keep the WireGuard interface")
|
||||||
flag.BoolVar(&acceptClients, "accept-clients", false, "Accept clients on the WireGuard interface")
|
flag.BoolVar(&acceptClients, "accept-clients", false, "Accept clients on the WireGuard interface")
|
||||||
if tlsPrivateKey == "" {
|
if tlsPrivateKey == "" {
|
||||||
flag.StringVar(&tlsPrivateKey, "tls-client-cert", "", "Path to client certificate used for mTLS")
|
flag.StringVar(&tlsPrivateKey, "tls-client-cert", "", "Path to client certificate used for mTLS")
|
||||||
|
|||||||
Reference in New Issue
Block a user