[agent] - bastion mode init
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
"wdd.io/agent-go/a_agent"
|
||||
"wdd.io/agent-go/a_init/bastion_init"
|
||||
)
|
||||
|
||||
/*
|
||||
@@ -74,17 +75,14 @@ func BastionModeInit() {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
|
||||
for {
|
||||
fmt.Print("> ")
|
||||
fmt.Print("enter ==> ")
|
||||
text, _ := reader.ReadString('\n')
|
||||
text = strings.TrimSpace(text)
|
||||
|
||||
if text == "quit" {
|
||||
break
|
||||
} else if text == "help" {
|
||||
fmt.Println("Available commands:")
|
||||
fmt.Println("- help: show this help message")
|
||||
fmt.Println("- quit: exit the program")
|
||||
fmt.Println("- [command name]: execute a command")
|
||||
bastion_init.PrintBastionHelp()
|
||||
} else {
|
||||
// Execute the command
|
||||
fmt.Println("Executing command:", text)
|
||||
|
||||
Reference in New Issue
Block a user