mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-02 10:01:37 +00:00
17 lines
402 B
JavaScript
17 lines
402 B
JavaScript
const fs = require('fs');
|
|
const Controller = require('./lib/controller');
|
|
const data = require('./lib/util/data');
|
|
|
|
if (process.env.ZIGBEE2MQTT_DATA) {
|
|
fs.copyFileSync('./data/configuration.yaml', data.joinPath('configuration.yaml'));
|
|
}
|
|
|
|
const controller = new Controller();
|
|
controller.start();
|
|
|
|
process.on('SIGINT', handleQuit);
|
|
|
|
function handleQuit() {
|
|
controller.stop(() => process.exit());
|
|
}
|