mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
27e988c484
- Implement POSIX-specific gateway process management in gateway_posix.go - Implement Windows-specific gateway process management in gateway_windows.go - Create a menu system in menu.go for user interaction - Develop model management functionality in model.go, including adding, deleting, and testing models - Introduce a style configuration in style.go for consistent UI appearance - Set up the main application entry point in main.go - Update go.mod and go.sum to include necessary dependencies for tcell and tview
17 lines
356 B
Go
17 lines
356 B
Go
//go:build !windows
|
|
// +build !windows
|
|
|
|
package ui
|
|
|
|
import "os/exec"
|
|
|
|
func isGatewayProcessRunning() bool {
|
|
cmd := exec.Command("sh", "-c", "pgrep -f 'picoclaw\\s+gateway' >/dev/null 2>&1")
|
|
return cmd.Run() == nil
|
|
}
|
|
|
|
func stopGatewayProcess() error {
|
|
cmd := exec.Command("sh", "-c", "pkill -f 'picoclaw\\s+gateway' >/dev/null 2>&1")
|
|
return cmd.Run()
|
|
}
|