Coder Social home page Coder Social logo

fivem-autoupdater's Introduction

FiveM Automatic Updater

This Node.js script provides an automatic updater for a FiveM FXServer. It checks for the latest release of FiveM, downloads the update if a new version is available, and updates the server accordingly.

Features

  • Automatic Update: The script automatically checks for the latest FiveM release and updates the server if a new version is available.
  • Scheduled Execution: The script is scheduled to run every day at 2:00 AM using node-cron.

Prerequisites

Before running the script, make sure you have the following installed:

  • Windows: You only have to install the npm packages
  • Linux: Install Tar

Linux

sudo apt install tar

Node.js

  • npm (Node.js package manager)
  • axios (HTTP client)
  • fs-extra (File system utilities)
  • node-cron (Task scheduler)

You can install the required packages using the following command:

npm i 
# or
npm install axios fs-extra node-cron

Configuration

You can customize the following constants at the beginning of the script according to your server setup:

{
    "Settings": {
        "Type": "Linux"
    }
}
  • Filter: An array of file patterns to filter and remove old files.
  • Type: write there what kind of system your server is running

Usage

  1. Clone or download the script to your server.
  2. Install the required packages as mentioned in the prerequisites section.
  3. Customize the TYPE constants if necessary.
  4. Run the script using the following command:
node index.js

Scheduled Execution

The script is scheduled to run every day at 2:00 AM using node-cron. You can modify the cron schedule as per your requirements:

cron.schedule('0 2 * * *', async () => {
    console.log('Running the FiveM Automatic Updater...');
    await updateServer();
});

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Disclaimer

This script is provided as-is without any warranty. Use it at your own risk.

fivem-autoupdater's People

Contributors

nici002018 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.