Shopping Cart
FiveM script 7e6606f0890bf5a4f89c914d241d5ed000f66fdd

Manage server FiveM (restart/start/stop/screen/status) on linux – Server Tutorials

[ad_1]

Hi !
I would like to add my small contribution for the management of a server FiveM under linux. I know there are already several topics, but I find some are incomplete or not practical uses, thatโ€™s why I created my own script.

Nothing complicated to use it.

You will need :

  • Server Linux
  • Server FiveM
  • A mouse
  • A keyboard
  • Putty (or other)

What does this script do?

It allows to start, restart, stop, screen, and check the status of its server FiveM. But not only!
It also restart mysql, clear the server cache and restart sessionmanager.


Putty

I will not show you how to use putty, itโ€™s way too simple.

  1. Open putty and connect to your linux server.
  2. Once connected, navigate to your FiveM directory via the command cd
  3. Once you are at the root of your server, use the wget command
wget https://raw.githubusercontent.com/HalCroves/Fivem-Serveur-management/master/manage.sh

  1. Technically, you should have a file named manage.sh at the root of your directory

  2. Now, edit this files. Two solutions, via the editor (vim/nanoโ€ฆ), or via your ftp if you are a slacker. I will use nano.

  3. Edit the manage.sh vith the command nano manage.sh. You go into edit mode
    image

  4. Arrived at this stage, You only have to modify a few lines.

8.Once modified, you just have to do CTRL + X, type O and press ENTER


Use script

/! At the first use, the fivem server must be completely off, because here I use as the name of screen fxserver

  1. To use this script, you must be at the root of your fivem server (ex: /home/FiveM).

    I advise you to use the dos2unix command (apt-get install dos2unix) to convert your file to the correct format.
    Like this :

    dos2unix manage.sh
    

    And you need to add permissions on this file :

    chmod -R 755 manage.sh
    
  2. Now, we simply use the command ./manage.sh start
    This will start the server.
    image


Other uses

./manage.sh start : start server
./manage.sh stop : stop server
./manage.sh restart : restart server
./manage.sh screen : connect to the screen (console)
./manage.sh status : lets you know if the fivem server is started or not


Add a cron task

If you want to use this script for an automatic reboot at any time, you must create a cron task.

For this, i use crontab -e. You need to defile the file editor with your arrow keys.

Exemple :

Here the server will reboot at 00:00, 12pm, 18pm.

00 00 * * * /home/FiveM/manage.sh restart
0 12 * * * /home/FiveM/manage.sh restart
0 18 * * * /home/FiveM/manage.sh restart

Once modified, you just have to do CTRL + X, type O and press ENTER

I do not know if I would update this post and the file. It was just to share.

Cordially,

Hal.

[ad_2]

Premium ESX Scripts? Click here!

Leave a Reply
FiveM ESX Scripts

The best scripts and maps

Best support

Problems? We are there to help!

Wide range of products

We have a wide range of products

100% Secure Checkout

Stripe