[agent] - bastion mode init

This commit is contained in:
zeaslity
2024-04-17 11:50:13 +08:00
parent f20d5e549c
commit d54ebfc7b0
2 changed files with 29 additions and 5 deletions

View File

@@ -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)