Files
factoryman/main.go
Raum0x2A b2c534f29b Fixes Changes and new additions
Fixed an issue where launching server w/o screen failed
New: added an output showing screen sessions after launching
New: added stdout and stdin to screenless launch allowing interacting with server cli
Change: Broke up source code to make it easier to read and make changes
Change: Updated .gitignore
2026-01-13 10:51:18 -07:00

39 lines
784 B
Go

package main
import (
"fmt"
"os"
)
func main() {
c := readCfg(fmConfig)
if len(os.Args) > 1 {
switch os.Args[1] {
case "start":
startStopServer("start", c)
case "stop":
startStopServer("stop", c)
case "backup":
if len(os.Args) > 2 {
switch os.Args[2] {
case "full":
backUp("full", c)
case "saves":
backUp("saves", c)
default:
fmt.Println("Invalid backup type: use 'full' or 'saves'")
}
} else {
fmt.Println("Missing backup type: use 'full' or 'saves'")
}
default:
fmt.Printf("Unknown command: %s. Use 'start', 'stop', or 'backup'.\n", os.Args[1])
}
} else {
fmt.Println("Use 'start', 'stop', or 'backup' command")
fmt.Println("ex. factoryman start")
fmt.Println("To configure edit 'conifg.yml'")
}
}