Built motion from commit 5293bb2a.|2.6.30
[motion2.git] / server / api / system / system.controller.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x4d1e=['params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','send','index','getAllData','status','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x5adc85,_0x4524f1){var _0x350e46=function(_0x541900){while(--_0x541900){_0x5adc85['push'](_0x5adc85['shift']());}};_0x350e46(++_0x4524f1);}(_0x4d1e,0x18e));var _0xe4d1=function(_0x1073ad,_0x44bf0b){_0x1073ad=_0x1073ad-0x0;var _0x528474=_0x4d1e[_0x1073ad];return _0x528474;};'use strict';var info=require(_0xe4d1('0x0'));var exec=require(_0xe4d1('0x1'))['exec'];var logger=require(_0xe4d1('0x2'))('api');var util=require(_0xe4d1('0x3'));var BPromise=require(_0xe4d1('0x4'));var _=require(_0xe4d1('0x5'));function handleError(_0x3fbd85,_0x2e2247,_0x365889){_0x2e2247=_0x2e2247||0x1f4;return function(_0x5a3d4d){logger[_0xe4d1('0x6')](_0xe4d1('0x7'),_0x365889,_0x2e2247,util['inspect'](_0x5a3d4d,{'showHidden':![],'depth':null}));delete _0x5a3d4d[_0xe4d1('0x8')];_0x3fbd85['status'](_0x2e2247)[_0xe4d1('0x9')](_0x5a3d4d);};}exports[_0xe4d1('0xa')]=function(_0x485f09,_0x30e264){return info[_0xe4d1('0xb')]()['then'](function(_0x309731){return _0x30e264[_0xe4d1('0xc')](0xc8)[_0xe4d1('0xd')](_0x309731);})[_0xe4d1('0xe')](function(_0x4d6528){return _0x30e264[_0xe4d1('0xc')](0x1f4)[_0xe4d1('0xd')](_0x4d6528);});};exports[_0xe4d1('0xf')]=function(_0x28ba9a,_0x193466){var _0x2e7ee8=['components/import/cm'];return new BPromise(function(_0x2e3177,_0x4eb976){return exec(util[_0xe4d1('0x10')](_0xe4d1('0x11'),_0x28ba9a[_0xe4d1('0x12')][_0xe4d1('0x13')]),function(_0x430ece,_0x8583bd,_0x5cb13d){if(_0x430ece){return _0x4eb976(_0x430ece);}return _0x2e3177(_0x8583bd);});})['then'](function(_0x26bb2a){var _0x493e1c=![];var _0x53039b=_0x26bb2a[_0xe4d1('0x14')](/\n/);for(var _0x45a613=0x0,_0x208dc4=_0x2e7ee8[_0xe4d1('0x15')];_0x45a613<_0x208dc4,_0x493e1c===![];_0x45a613+=0x1){if(_0x26bb2a[_0xe4d1('0x16')](_0x2e7ee8[_0x45a613])>=0x0){_0x493e1c=!![];}}if(!_0x493e1c){throw new Error(util[_0xe4d1('0x10')](_0xe4d1('0x17'),_0x28ba9a['params']['pid']));}process['kill'](_0x28ba9a[_0xe4d1('0x12')]['pid'],_0xe4d1('0x18'));return _0x193466[_0xe4d1('0xc')](0xc8)[_0xe4d1('0xd')]({'message':util[_0xe4d1('0x10')](_0xe4d1('0x19'),_0x28ba9a[_0xe4d1('0x12')][_0xe4d1('0x13')])});})['catch'](handleError(_0x193466,null,_0xe4d1('0xf')));};