Permalink
Browse files

Minor fixes

  • Loading branch information...
1 parent 670cb97 commit 9655d2635a1d3c463126070b0e7dbeae223da130 @Xaekai Xaekai committed Jul 22, 2016
Showing with 5 additions and 5 deletions.
  1. +3 −3 index.js
  2. +2 −2 servcmd.sh.js
View
@@ -45,7 +45,7 @@ process.stdin.on("data", function (data) {
}
});
-var net = require('net');
+var validIP = require('net').isIP;
function handleLine(line) {
if (line === "/reload") {
Logger.syslog.log("Reloading config");
@@ -78,7 +78,7 @@ function handleLine(line) {
sv.reloadPartitionMap();
} else if (line.indexOf("/globalban") === 0) {
var args = line.split(/\s+/); args.shift();
- if (args.length >= 2 && net.isIP(args[0]) !== 0) {
+ if (args.length >= 2 && validIP(args[0]) !== 0) {
var ip = args.shift();
var comment = args.join(' ');
require("./lib/database").globalBanIP(ip, comment, function (err, res) {
@@ -89,7 +89,7 @@ function handleLine(line) {
}
} else if (line.indexOf("/unglobalban") === 0) {
var args = line.split(/\s+/); args.shift();
- if (args.length === 1 && net.isIP(args[0]) !== 0) {
+ if (args.length >= 1 && validIP(args[0]) !== 0) {
var ip = args.shift();
require("./lib/database").globalUnbanIP(ip, function (err, res) {
if (!err) {
View
@@ -105,8 +105,8 @@ function cmdouthndlr(type, args) {
function cleanup(){
console.info('\n',"Terminating.",'\n');
- eventlog.stdin.end();
- syslog.stdin.end();
+ eventlog.kill('SIGTERM');
+ syslog.kill('SIGTERM');
client.end();
process.exit(0);
}

0 comments on commit 9655d26

Please sign in to comment.