UNPKG

@remote.it/core

Version:

Core remote.it JavasScript/TypeScript library

45 lines 1.64 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var debug_1 = __importDefault(require("debug")); var child_process_1 = require("child_process"); var d = debug_1.default('remoteit:Systemd'); var Systemd = /** @class */ (function () { function Systemd(name) { if (name === void 0) { name = 'remoteit'; } this.name = name; } Systemd.prototype.start = function () { d('start'); child_process_1.execFileSync('systemctl', ['start', this.name]); }; Systemd.prototype.stop = function () { d('stop'); child_process_1.execFileSync('systemctl', ['stop', this.name]); }; Systemd.prototype.restart = function () { d('restart'); child_process_1.execFileSync('systemctl', ['restart', this.name]); }; Systemd.prototype.reload = function () { d('reload'); child_process_1.execFileSync('systemctl', ['reload', this.name]); }; Systemd.prototype.enable = function () { d('enable'); child_process_1.execFileSync('systemctl', ['enable', this.name]); }; Systemd.prototype.disable = function () { d('disable'); child_process_1.execFileSync('systemctl', ['disable', this.name]); }; Systemd.prototype.reboot = function () { d('reboot'); child_process_1.execFileSync('systemctl', ['daemon-reload', this.name]); }; return Systemd; }()); exports.Systemd = Systemd; //# sourceMappingURL=Systemd.js.map