forked from rabchev/web-terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.js
32 lines (26 loc) · 1.15 KB
/
run.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env node
/*jslint plusplus: true, devel: true, nomen: true, node: true, vars: true, indent: 4, maxerr: 50 */
var commander = require("commander"),
terminal = require("../"),
pkg = require("../package.json");
if (commander.options.length === 0) {
commander
.version(pkg.version)
.option("-i, --interface <ip>", "Interface (ip) to listen on.")
.option("-p, --port <port>", "Specifies the TCP port for the HTTP server.")
.option("-s, --ssl", "Start HTTP server over secure socket layer.")
.option("-h, --shell <shell>", "Executes commands in the specified command shell. Example: --shell bash")
.option("-l, --login", "Require login to use the terminal. The process is executed with the logged user account. NOTE: this option works only for POSIX platforms and it requires libpam-dev package to be installed prior to installing web-terminal.")
.parse(process.argv);
}
if (commander.shell) {
process.env.WEB_SHELL = commander.shell;
}
if (commander.login) {
process.env.WEBT_LOGIN = commander.login;
}
terminal({
port: commander.port,
interface: commander.interface,
ssl: commander.ssl,
});