world/New()
world.log=file("Monitorlog.txt");
Check_Server()
var/failattempts
proc
Check_Server()
var/SERVER = world.Export("byond://127.0.0.1:1709?ping")
if(!SERVER)
world.log<<"<[time2text(world.timeofday)]> Server failed to respond"
failattempts++;
if(failattempts>2)
world.log<<"<[time2text(world.timeofday)]> Reboot Attempted"
world.log<<"----------------------"
startup("dmu/dmu.dmb",1709,"-trusted")
failattempts=0;
spawn(10)
Check_Server()
Problem description:
This code works perfectly fine on Windows.
However, neither logging output or running of a server works on a Linux machine.
Any ideas?
As for your snippet, notice how you can remove a global variable by moving it inside the proc and looping instead of recursively calling the proc over and over: