Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
BoLaMN committed Jan 14, 2020
1 parent 5ab3dfb commit d8da720
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
12 changes: 11 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var args, ask, dhcpd, httpd, ip, pkg, port, servers, tftp;
var args, ask, dhcpd, httpd, ip, pkg, port, rl, servers, tftp;

pkg = require('../package.json');

Expand Down Expand Up @@ -36,6 +36,16 @@ if (args.tftp) {
});
}

if (process.platform === 'win32') {
rl = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
rl.on('SIGINT', function() {
return process.emit('SIGINT');
});
}

process.on('SIGINT', function() {
console.log("\nshutting down servers from SIGINT (Ctrl+C)");
servers.forEach(function(server) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tch-exploit",
"version": "2.0.1-rc5",
"version": "2.0.1-rc6",
"main": "dist/index.js",
"bin": "dist/index.js",
"scripts": {
Expand Down
10 changes: 9 additions & 1 deletion src/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,17 @@ else
servers.push dhcpd ip, url, args.acspass
servers.push httpd ip, p, url

if process.platform is 'win32'
rl = require('readline').createInterface
input: process.stdin
output: process.stdout

rl.on 'SIGINT', ->
process.emit 'SIGINT'

process.on 'SIGINT', ->
console.log "\nshutting down servers from SIGINT (Ctrl+C)"

servers.forEach (server) ->
server.close()

Expand Down

0 comments on commit d8da720

Please sign in to comment.