diff --git a/config.go b/config.go index 4e76cce..c8615a4 100644 --- a/config.go +++ b/config.go @@ -11,12 +11,15 @@ import ( func DefCfg() *DefConfig { c := &DefConfig{} + // server settings c.Server.ServDir = "factorio" c.Server.ServPort = 34197 c.Server.ServCfg = "factorio/data/server-settings.json" c.Server.ServExec = "factorio/bin/x64/factorio" c.Server.WorldFile = "factorio/saves/newworld.zip" + + // factoryman settings c.Factoryman.UseScreen = true c.Factoryman.ScreenName = "factorio" c.Factoryman.BackupDir = "factorio/backups" diff --git a/serv-install.go b/serv-install.go index f73cf1e..db400ac 100644 --- a/serv-install.go +++ b/serv-install.go @@ -6,12 +6,14 @@ import ( "log" "net/http" "os" + "os/exec" "path/filepath" "github.com/therootcompany/xz" ) func downloadHeadless() { + var c = readCfg("config.yml") headlessQuery := "https://www.factorio.com/get-download/latest/headless/linux64" url := headlessQuery @@ -42,4 +44,6 @@ func downloadHeadless() { outFile.Close() } } + // zip does not preserve permissions correctly so i have to do this + exec.Command("chmod", "+x", c.Server.ServExec) }