Skip to content

Administration program for stop/start/restart your gt-mp server, save in-real-time logs, kill screen sessions, etc.

License

Notifications You must be signed in to change notification settings

hakiour/GTMP-SYSTEM-ADMINISTRATOR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GT-MP SYSTEM ADMINISTRATOR

Administration program for stop/start/restart your gt-mp server, save in-real-time logs, kill screen sessions, etc.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • GNU/Linux System (tested on Debian Stretch & Ubuntu Server 16.04.3 LTS)

  • Functional GT-MP Server

  • Screen - As window manager

  • php > 5.3

Optionals:

  • wget
  • unzip

Installing

First we need to download the script on our server, you can do it throught sftp, git, etc. I do it with the wget command

wget https://github.com/hakiour/GTMP-SYSTEM-ADMINISTRATOR/archive/master.zip

Then, if you download the script with wget, we have a .zip file, unzip it with

unzip master.zip

Now we need the executable permisions on the script, we can do this with the chmod command

chmod +x gtmp

If we use ls -l:

we can see that we have the executable permision added on the gtmp script.

Configuration file

The configuration file is were the global settings for this script are setted. By default the file name is gtmp_config, saved on the same folder as the gtmp script.

Parameters

  • $path = /home/hamza/gt-mp/ : The path of the executable server file, in this case, under the folder /home/hamza/gt-mp/ I have the GrandTheftMultiplayer.Server.exe executable file.

  • $executable = GrandTheftMultiplayer.Server.exe : The name of the executable server file, by default is GrandTheftMultiplayer.Server.exe, but if you change the name of the executable file, need to reflect it on this parameter.

  • $instance_name = gtav : The name of the screen session, you can write whatever you want (no spaces), by default is gtav.

  • $savelog = y : If it's true (y), when you start the server automatically is generater a gtmp-server.log file where it's saved all the commands (and the ouputs) generates on the screen session. Possible answers: yes (y) or no (n), default value is y.

    • Example of how the log looks like by default:
  • $timestampOnLog = n : Complement of $savelog paramenter, when is true (y), automatically print the timestamp on the log file. Possible answers: yes (y) or no (n), default value is n.

    • Example of how the log looks like with the $timestampOnLog on :
  • $alwaysSafeStart = y : If it's true (y), before you start the server, kill the old screen session (if there's more than one session, kill them all, that's why is safe), after killing the screen sessions (or if there is no one), create a new one. It's the same when you stop the server, after stopping it, kill the screen sessions. It's ideal if you want a clean start/stop.

Generating a new gtmp_config file

If we don't have the gtmp_config file, we can run the script ./gtmp start and the script automatically set up a new gtmp_config file:

But if we have one gtmp_config file and wanna generate a new one, call the script with the newconf parameter (./gtmp newconf). The newconf save your old gtmp_config file as gtmp_config.old

Comands

Syntax

The syntaxis is: ./gtmp + [Parameter1] + [OptionalParameter2], Ex: gtmp start -f

Parameters

  • start: With this parameter we order the server to start, if we don't have the $alwaysSafeStart, we need to have a screen session running (with the correct $instance_name), if we don't have a screen session running, we can call the parameter -f (force).
    • -f (force): with the start command, this create a screen session if there is no one, then start the server, if there is some screen session running, the program kill them (only de GT-MP screens) and then execute a new one.

Example:

./gtmp start -f

Live example:

Here you can see how there is no screen session running, and because that the command fail the execution of the server, if we call the parameter -force, we force the creation of a screen session:


* `stop`: With this parameter we order the server to stop, if we don't have the `$alwaysSafeStop`, the program don't kill screen session (what means it still online in the background), we can call the parameter `-f`orce for kill the screen sessions. * `-f` (force): with the stop command, kill the screen GT-MP screen sesions after shutting down the server (it's the same as `$alwaysSafeStop`).

Example:

./gtmp stop -f

* `restart`: With this parameter we order the server to stop, and then start again. This command execute a `./gtmp start` and `./gtmp stop`, that means the parameters on `gtmp_config` (`$alwaysSafeStart`, `$alwaysSafeStop`, etc. affects this command). We can call the parameter `-f`orce for emulate `$alwaysSafeStart` and `$alwaysSafeStop`.

Example:

./gtmp restart -f

* `-l`: life version, with this parameter we can follow the status of our server in real time (2 sec delay). We can add this to all commands or call it witouth any command.

Example:

./gtmp -l
./gtmp start -l

Built With

Possible errors and how to solve it

'Cannot open your terminal '/dev/pts/3' - please check.' - description: This error occurs when you wanna access to the screen session with an user who don't log in the system correctly, what means he don't have his own terminal session (run script /dev/null to own the shell).

Authors

  • Hamza Akiour - Developer, Sysadmin & tecLover - Hamza Akiour

License

This project is licensed under the GNU (General Public License) - see the LICENSE file for details

About

Administration program for stop/start/restart your gt-mp server, save in-real-time logs, kill screen sessions, etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages