Jump to content

Automated Messages for restart


Guest JPhix

Recommended Posts

  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

Guest JPhix

yeah i have no intention of running wine on my linux server was kinda hoped it could be done through a script or something like that if thats the only way then i guess i'll dig around the rcon code and make somthing in php and run a couple of cronjobs 

Link to comment
Share on other sites

well so far i cant even connect to my servers battleye so untill i can get that working cant do anything message wise i'v tryed in /home/dayz/arma2ao/cfgdayz/battleye /home/dayz/arma2ao/expansion/battleye and /home/dayz/arma2ao/battleye and still nothing for changeme or the password i set in the files any idea's ?

Link to comment
Share on other sites

ok heres my Cronjobs 

30 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/30min.php
45 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/15min.php
50 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/10min.php
55 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/5min.php
56 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/4min.php
57 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/3min.php
58 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/2min.php
59 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/1min.php

Download link http://188.165.219.207/Restart.tar.gz

 

simple as edit config.php setup the cronjobs and u have 30 min warnings on restarts

Link to comment
Share on other sites

ok heres my Cronjobs 

30 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/30min.php
45 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/15min.php
50 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/10min.php
55 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/5min.php
56 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/4min.php
57 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/3min.php
58 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/2min.php
59 3,7,11,15,19,23 * * * php -q /home/dayz/Restart/1min.php

Download link http://188.165.219.207/Restart.tar.gz

 

simple as edit config.php setup the cronjobs and u have 30 min warnings on restarts

 

Hi,

 

How to use this for auto restart ? Please

Just edit the config.php and add the rules in cron?

And the server restart every 4 hours?
 
Thanks
 
Edite :
 
When I execute this commande : 
 php -q /home/serveur/arma2/restart/30min.php

I get this : 

Got Socket!
Attempting Login

And nothing else, no work, why ? :(

 
Edit 2: 
I use this in my cron :
0 0,4,8,12,16,20 * * * cd / && /home/serveur/arma2/restarter.pl
30 3,7,11,15,19,23 * * * php -q /home/serveur/arma2/restart/30min.php
45 3,7,11,15,19,23 * * * php -q /home/serveur/arma2/restart/15min.php
50 3,7,11,15,19,23 * * * php -q /home/serveur/arma2/restart/10min.php
55 3,7,11,15,19,23 * * * php -q /home/serveur/arma2/restart/5min.php
56 3,7,11,15,19,23 * * * php -q /home/serveur/arma2/restart/4min.php
57 3,7,11,15,19,23 * * * php -q /home/serveur/arma2/restart/3min.php
58 3,7,11,15,19,23 * * * php -q /home/serveur/arma2/restart/2min.php
59 3,7,11,15,19,23 * * * php -q /home/serveur/arma2/restart/1min.php

But it not work... No restart.

Link to comment
Share on other sites

Hey Musyanon,

 

normally you restart yoiur (Windows) Server via BEC or something similar. You cannot use this under linux.

For the linux server adaptions by DEVD you need to restart the server via the restarter.pl script.

 

The scripts we are talking about here is only a warning send to the players via an php battleye client. These scripts do NOT restart the server, they just remember the peolple playing on the server (at 60, 40, 15,... mins before your scheduled restart of restarter.pl in crontab).

 

Regards,

jahan.

Link to comment
Share on other sites

Hm, add this at the end of your crontab line to log something to a file:

>> /home/serveur/arma2/restart.log

 

I guess the epoch binary can not be found or something. I set the path contant in the beginning of my restarter.pl to the absolute path to my server directory.

 

Restart messages: you forgot to mention what you did to set this up and why you think it's not working.

Link to comment
Share on other sites

Hm, add this at the end of your crontab line to log something to a file:

>> /home/serveur/arma2/restart.log

 

I guess the epoch binary can not be found or something. I set the path contant in the beginning of my restarter.pl to the absolute path to my server directory.

 

Restart messages: you forgot to mention what you did to set this up and why you think it's not working.

 

 

Here is the log :

Got Socket!
Attempting Login
Got Socket!
Attempting Login
Got Socket!
Attempting Login
Got Socket!
Attempting Login
Got Socket!
Attempting Login
Got Socket!
Attempting Login
Got Socket!
Attempting Login
Got Socket!
Attempting Login
Can't found server binary!

About restart messages I placed the scripts in folder "restart" at the root of my server folder. And I edit the config.php file

<?php
define("address","127.0.0.1");	// server address
define("port","2302");	// server port
define("password","mypasswd");	// battleye password
?>

But nothing works :(

 

If I put a wrong password in the config.php, I get the message "Login Failed!". So I guess the problem is not there

 

What should I change in the restarter.pl?

 

Thank you for your help

Link to comment
Share on other sites

Change the PATH at the beginning of restarter.pl to your server dir.

e.g.: use constant PATH      => '/home/dayz/server1042/';

Then the script will find the binary and everything else executed from everywhere.

 

For the restart message scripts it does not matter where they are. If the server runs and the password is correct they send a message whenever you execute them.

Each should be executed by cron X minutes before restart really happens as shown in the thread for the restart scripts.

E.g.:

55 3,7,11,15,19,23 * * * php5 /home/dayz/Restart/5min.php

(Which warns 5 minutes before restart; at 5 before 4, 5 before 8, 5 before 12 and so on. Such a line you will need for each script.)

Link to comment
Share on other sites

define("address","127.0.0.1");	// server address
define("port","2302");	// server port
define("password","mypasswd");	// battleye password
?>

But nothing works :(

 

If I put a wrong password in the config.php, I get the message "Login Failed!". So I guess the problem is not there

 

What should I change in the restarter.pl?

 

Thank you for your help

 

try using the external ip,  eg. 123.456.789.321  

Link to comment
Share on other sites

Localhost works for me...so the loopback adress will also. Maybe the same problem that jphix had in the beginning: battleye=0 in the server config. If not and you still want help, please post a bit more to have a look into. Are you able to connect to battleye from inside the game?

Link to comment
Share on other sites

@all: if you don't want to get lots of emails to your servers user account add somethig like '>/dev/null 2>&1' behind your script execution lines in cron:

 

E.g. 00 2,6,10,14,18,22 * * * php5 /home/dayzepoch/Restart/120min.php >/dev/null 2>&1

 

I recognized today that I had thousands of mails with the succes messages of the restart warning scripts ('mail' in shell).

Link to comment
Share on other sites

  • 5 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

  • Discord

×
×
  • Create New...