view rlgwebd-stop @ 198:ea28353d620a

Make sure games have saved and exited before stopping the server. This should make the systemd version safe for production, though it can't yet deal with a game that hangs and doesn't exit.
author John "Elwin" Edwards
date Thu, 28 Jan 2016 21:17:06 -0500
parents 3bdee6371c3f
children a7cc38a0168d
line wrap: on
line source

#!/usr/bin/env node

var net = require('net');
var sockpath = "/var/run/rlgwebd.sock";

var sock = net.connect(sockpath, function () {
  sock.on('close', function () {
    if (process.argv[2] == "debug")
      console.log("Control socket closed");
  });
  sock.write("quit\n");
});