mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-20 09:46:19 +00:00
Fixed syntax errors
This commit is contained in:
parent
48c5766f3d
commit
c98a274bde
@ -7,11 +7,15 @@ api = express()
|
||||
LED_FILE = '/sys/class/leds/led0/brightness'
|
||||
blink = (ms = 200, callback) ->
|
||||
fs.writeFileSync(LED_FILE, 1)
|
||||
setTimeout(-> fs.writeFile(LED_FILE, 0, callback), ms)
|
||||
setTimeout(->
|
||||
fs.writeFile(LED_FILE, 0, callback)
|
||||
, ms)
|
||||
|
||||
api.post('/blink', (req, res) ->
|
||||
interval = setInterval(blink, 400)
|
||||
setTimeout(-> clearInterval(interval), 5000)
|
||||
setTimeout(->
|
||||
clearInterval(interval)
|
||||
, 5000)
|
||||
res.send(200)
|
||||
)
|
||||
|
||||
|
@ -13,15 +13,13 @@ console.log('Supervisor started..')
|
||||
newUuid = utils.getDeviceUuid()
|
||||
oldUuid = knex('config').select('value').where(key: 'uuid')
|
||||
|
||||
bootstrap = Promise.all([newUuid, oldUuid]).then(([newUuid, [oldUuid]]) ->
|
||||
Promise.all([newUuid, oldUuid]).then(([newUuid, [oldUuid]]) ->
|
||||
if newUuid is oldUuid
|
||||
return true
|
||||
|
||||
console.log('New device detected. Bootstrapping..')
|
||||
return bootstrap(newUuid)
|
||||
)
|
||||
|
||||
bootstrap.then(->
|
||||
).then(->
|
||||
console.log('Starting OpenVPN..')
|
||||
openvpn = spawn('openvpn', ['client.conf'], cwd: '/supervisor/data')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user