fix(sdk): Load usbboot adapter on start

Change-type: patch
Changelog-entry: Load usbboot adapter on start on GNU/Linux if running as root.
Signed-off-by: Alexis Svinartchouk <alexis@resin.io>
This commit is contained in:
Alexis Svinartchouk
2018-05-01 19:36:12 +02:00
committed by Lorenzo Alberto Maria Ambrosi
parent fd19af23a6
commit 26779ef1fb
3 changed files with 24 additions and 18 deletions

View File

@@ -70,6 +70,26 @@ exports.isElevated = () => {
return Bluebird.resolve(process.geteuid() === UNIX_SUPERUSER_USER_ID)
}
/**
* @summary Check if the current process is running with elevated permissions
* @function
* @public
*
* @description
*
* @returns {Boolean}
*
* @example
* permissions.isElevatedUnixSync()
* if (isElevated) {
* console.log('This process has elevated permissions');
* }
* });
*/
exports.isElevatedUnixSync = () => {
return (process.geteuid() === UNIX_SUPERUSER_USER_ID)
}
/**
* @summary Get environment command prefix
* @function