Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions cmd/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"net/url"
"os"
"os/exec"
"path"
"regexp"
"time"
Expand Down Expand Up @@ -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.")
}

Expand Down