Initial implementation of custom commands feature (e.g. telnet).
This commit is contained in:
1 parent
3c7f554264
commit
ff286080e8
5 files changed
+63
-2
No files matched your search
@@ -0,0 +1,17 @@
|
||||
common = require './common'
|
||||
|
||||
exports.execute = (deviceId, command, callback) ->
|
||||
args = command.split(/\s+/)
|
||||
f = args.shift()
|
||||
c = args.shift()
|
||||
|
||||
file = require "./config/custom_commands/#{f}"
|
||||
file[c](deviceId, args.join(' '), callback)
|
||||
|
||||
|
||||
exports.getCommands = (filename) ->
|
||||
commands = []
|
||||
f = require("./config/custom_commands/#{filename}")
|
||||
for k,v of f
|
||||
commands.push(k)
|
||||
return commands
|
||||
Reference in new issue
Block a user