forked from bitfocus/companion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheadless_ip.js
More file actions
executable file
·29 lines (24 loc) · 777 Bytes
/
Copy pathheadless_ip.js
File metadata and controls
executable file
·29 lines (24 loc) · 777 Bytes
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
#!/usr/bin/env node
var system = require('./app.js')
console.log('Starting')
if (process.argv.length < 3) {
console.log('Usage: ./headless.js <address> [port]')
console.log('')
console.log('Example: ./headless.js 192.168.81.1')
process.exit(1)
}
if (process.env.COMPANION_CONFIG_BASEDIR !== undefined) {
system.emit('skeleton-info', 'configDir', process.env.COMPANION_CONFIG_BASEDIR)
} else {
system.emit('skeleton-info', 'configDir', process.env[process.platform == 'win32' ? 'USERPROFILE' : 'HOME'])
}
var port = '8000'
if (process.argv[3] != null) {
port = process.argv[3]
}
setTimeout(function () {
system.emit('skeleton-bind-ip', process.argv[2])
system.emit('skeleton-bind-port', port)
system.ready(!process.env.DEVELOPER)
console.log('Started')
}, 1000)