Auto-detect "incorrect region header" in 7 Days To Die dedicated server logs and auto-restore corrupt .7rg region files from backups.
RegionAutoFix is the shell-first subtool in this repo: it tails the server log, detects corruption, stops the server safely, restores from the newest backup (with escalation to older backups on repeated failures), and restarts the server. Optional Discord webhooks and telnet heartbeats are supported.
- Shell-first: Bash + coreutils,
tail,grep,awk/sed,flock,nc,curl. Minimal dependencies. - Linux target: Runtime expects a Linux environment with these utilities. Development on Windows is fine; run the tool on the same host (or an accessible host) where the 7DTD server runs.
-
Clone the repo
git clone https://github.com/248Tech/RegionHealer-v2 RegionHealer-v2 && cd RegionHealer-v2
-
Create config from template
Copy the example config so you don't commit secrets:cp RegionAutoFix/config.env.example RegionAutoFix/config.env
-
Edit
RegionAutoFix/config.env
Set at least:worldsave,backup,logfile, and optionallywebhook,telnet,startcmd/stopcmd. See RegionAutoFix/README.md for all options. -
Ensure directories exist
The tool createsSaves/,Logs/, andState/as needed; you can create them manually if you prefer. -
Make scripts executable
chmod +x RegionAutoFix/run.sh RegionAutoFix/lib/*.sh -
Run
./RegionAutoFix/run.sh
Logs go to
RegionAutoFix/Logs/autofix_YYYY-MM-DD_HH-MM-SS.log. -
Optional: Use
dry_run="true"in config to test without stopping the server or overwriting files. -
Full details: Install steps, configuration reference, systemd, troubleshooting, and safety notes are in RegionAutoFix/README.md.
- Do not commit
RegionAutoFix/config.env. It may contain paths, Discord webhook URLs, and telnet passwords. - Use
RegionAutoFix/config.env.exampleas the tracked template with placeholder values and comments. - Copy to
config.envlocally and addRegionAutoFix/config.envto.gitignoreso it is never committed.