feat: --deploy-all flag, fix menu numbering, update clean.sh
This commit is contained in:
parent
216b24b9ac
commit
8f9c0ac10c
1 changed files with 23 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ var version = "dev"
|
|||
func main() {
|
||||
ver := flag.Bool("version", false, "Show version")
|
||||
tun := flag.Bool("tunnel", false, "Start reverse SSH tunnel")
|
||||
all := flag.Bool("deploy-all", false, "Deploy all undeployed nodes from fw.conf")
|
||||
flag.Parse()
|
||||
|
||||
if *ver {
|
||||
|
|
@ -34,6 +35,10 @@ func main() {
|
|||
startTunnel()
|
||||
return
|
||||
}
|
||||
if *all {
|
||||
deployAll()
|
||||
return
|
||||
}
|
||||
|
||||
// Run preflight, then interactive menu
|
||||
result := preflight.Run()
|
||||
|
|
@ -203,6 +208,24 @@ func isDeployed(name string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// ─── Deploy All ────────────────────────────────────────────────────────
|
||||
|
||||
func deployAll() {
|
||||
nodes := loadNodes()
|
||||
if len(nodes) == 0 {
|
||||
fmt.Println("No nodes configured in /opt/fw/fw.conf")
|
||||
return
|
||||
}
|
||||
for _, nc := range nodes {
|
||||
if isDeployed(nc.Name) {
|
||||
fmt.Printf("✓ %s already deployed\n", nc.Name)
|
||||
continue
|
||||
}
|
||||
fmt.Printf("\nDeploying %s...\n", nc.Name)
|
||||
deployOne(nc)
|
||||
}
|
||||
}
|
||||
|
||||
// ─── Deploy ───────────────────────────────────────────────────────────
|
||||
|
||||
func deployMenu() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue