mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-17 16:53:13 +00:00
Updated to only use fs.Watch if it exists
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -346,12 +346,15 @@ function UserSessions()
|
|||||||
else if(process.platform == 'linux')
|
else if(process.platform == 'linux')
|
||||||
{
|
{
|
||||||
var dbus = require('linux-dbus');
|
var dbus = require('linux-dbus');
|
||||||
this._linuxWatcher = require('fs').watch('/var/run/utmp');
|
if (require('fs').watch)
|
||||||
this._linuxWatcher.user_session = this;
|
|
||||||
this._linuxWatcher.on('change', function (a, b)
|
|
||||||
{
|
{
|
||||||
this.user_session.emit('changed');
|
this._linuxWatcher = require('fs').watch('/var/run/utmp');
|
||||||
});
|
this._linuxWatcher.user_session = this;
|
||||||
|
this._linuxWatcher.on('change', function (a, b)
|
||||||
|
{
|
||||||
|
this.user_session.emit('changed');
|
||||||
|
});
|
||||||
|
}
|
||||||
this._users = function _users()
|
this._users = function _users()
|
||||||
{
|
{
|
||||||
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||||
|
|||||||
Reference in New Issue
Block a user