Minor fixes

This commit is contained in:
Xaekai 2016-07-21 18:17:38 -07:00
parent 670cb97e79
commit 9655d2635a
2 changed files with 5 additions and 5 deletions

View File

@ -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 File

@ -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);
}