From a9d93c3e5ffb1a5f9e020f9cec41890b35a0a772 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 14 Aug 2025 20:35:27 +0200 Subject: [PATCH] Update configure.go --- cmd/configure.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cmd/configure.go b/cmd/configure.go index ae92a1567..9bf5decd8 100644 --- a/cmd/configure.go +++ b/cmd/configure.go @@ -8,6 +8,7 @@ import ( "net/http" "net/url" "os" + "os/exec" "path" "regexp" "time" @@ -162,6 +163,23 @@ func configureCmdRun(cmd *cobra.Command, args []string) { panic(err) } + // Ask user if they want to restart Wings after config + var restartWings bool + survey.AskOne(&survey.Confirm{ + Message: "Restart Wings to apply changes?", + Default: true, + }, &restartWings) + + if restartWings { + fmt.Println("Restarting Wings...") + err := exec.Command("systemctl", "restart", "wings").Run() + if err != nil { + fmt.Println("Failed to restart Wings:", err) + os.Exit(1) + } + fmt.Println("Wings restarted successfully.") + } + fmt.Println("Successfully configured wings.") }