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() {
|
func main() {
|
||||||
ver := flag.Bool("version", false, "Show version")
|
ver := flag.Bool("version", false, "Show version")
|
||||||
tun := flag.Bool("tunnel", false, "Start reverse SSH tunnel")
|
tun := flag.Bool("tunnel", false, "Start reverse SSH tunnel")
|
||||||
|
all := flag.Bool("deploy-all", false, "Deploy all undeployed nodes from fw.conf")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if *ver {
|
if *ver {
|
||||||
|
|
@ -34,6 +35,10 @@ func main() {
|
||||||
startTunnel()
|
startTunnel()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if *all {
|
||||||
|
deployAll()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Run preflight, then interactive menu
|
// Run preflight, then interactive menu
|
||||||
result := preflight.Run()
|
result := preflight.Run()
|
||||||
|
|
@ -203,6 +208,24 @@ func isDeployed(name string) bool {
|
||||||
return false
|
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 ───────────────────────────────────────────────────────────
|
// ─── Deploy ───────────────────────────────────────────────────────────
|
||||||
|
|
||||||
func deployMenu() {
|
func deployMenu() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue