my method of extracting archives does not preserve permission
this has be fixed with a workaround by using chmod to make factorio
executable
This commit is contained in:
2026-05-04 13:11:29 -06:00
parent 9e7bd21602
commit 3d24198ad3
2 changed files with 7 additions and 0 deletions

View File

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

View File

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