Skip to content

nidaren/EcoServerRestarterScript

Repository files navigation

Eco Server Restarter Script

This is a PowerShell script will restart Eco Server at the specifed hours. It is designed to work on Windows hosts.

Features

  • It can run without admin priviledges on the host system.
  • Terminates EcoServer properly via SIGINT signal.
  • Allows EcoServer to save before exiting.
  • Supports multiple restart hours - only two defined, but additional may be added too.
  • Detects EcoServer crashes and restarts it if needed.

How to use the script

  1. Download the script files from the releases section.

  2. Unpack files to where EcoServer.exe file sits.

  3. Generate Eco User Token on https://play.eco/account in Server Authentication section.

  4. Edit file NidEcoRestarter.json and:

    • Paste your token from step 3 into "YOUR_ECO_TOKEN_HERE" section. Make sure you preserve quotations around it.
    • Edit Restart Times in RestartTimes section. Only two hours are defined by default, but you can add more if needed.
  5. Right click on both NidEcoRestarterLauncher.cmd, NidEcoServerRestarter.ps1 as well as wk.exe located in NidEcoServerRestarter folder and select Unblock then Apply. Files downloaded from internet are by default blocked on some systems.

  6. Run NidEcoRestarterLauncher.cmd to run the script - it will run on accounts without administrative priviledges. It also ensures that script can be executed even on hosting systems with restrictive group policy. Do not run .ps1 script file directly.

  7. If any errors occur or window closes imidiatelly, check log file for errors.

File logger

File logger will be placed in the same directory as the script, its name can be changed in the Configuration section of the script. It saves the time of the events within the script.

Removal

  • Manual: Delete the unpacked files.

  • Automatic: Download NidRestarterRemover.cmd available in Releases on GitHub. Drop it to the folder containing EcoServer.exe and run.

Important notes

Regular users DO NOT NEED to edit the .ps1 script file directly. Eco token and restart times can be defined in NidEcoRestarter.json. This ensures that when script is updated none of your settings are lost.

Script files MUST be placed to where EcoServer.exe file resides.

It operates at 24 hour format so 9:00PM should be defined as 21:00 and so on.

If EcoServer crashes for whatever reason it will also be automatically restarted. This check is made every 10 seconds.

Please DO NOT define exact midnight 00:00 as restart hour as at this time script resets its flags. If you want restart at midnight use 00:01 for example.

Attributions

Uses wk.exe for proper signal sending. Use is under MIT license and original project page as well as source code is located at https://github.com/ElyDotDev/windows-kill

About

PowerShell script to manage EcoServer restarts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published