pooliot-client
Version:
29 lines (26 loc) • 743 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
var _fs = require('fs');
exports.default = (clientDirectory, pkg, { address, token, user, webPort }) => {
(0, _fs.writeFileSync)(`/etc/systemd/system/${pkg.name}.service`, `
[Unit]
Description=${pkg.description}
After=network.target
[Service]
Type=simple
WorkingDirectory=${clientDirectory}
ExecStart=${process.argv[0]} .
Restart=always
Environment=NODE_ENV=production
Environment=SERVER_ADDRESS=${address}
Environment=TOKEN=${token}
Environment=USER=${user}
Environment=WEB_PORT=${webPort || 80}
SyslogIdentifier=${pkg.name}
[Install]
WantedBy=multi-user.target
`.trim());
};
//# sourceMappingURL=createSystemdService.js.map
;