Built motion from commit (unavailable).|2.5.21
[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 _0x889e=['child_process','../../config/logger','util','bluebird','lodash','error','name','status','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation'];(function(_0x34a62a,_0xad7cc2){var _0x3a3ecf=function(_0x37fbe6){while(--_0x37fbe6){_0x34a62a['push'](_0x34a62a['shift']());}};_0x3a3ecf(++_0xad7cc2);}(_0x889e,0x77));var _0xe889=function(_0x2f0be3,_0x5e18c1){_0x2f0be3=_0x2f0be3-0x0;var _0x2eb9f1=_0x889e[_0x2f0be3];return _0x2eb9f1;};'use strict';var info=require(_0xe889('0x0'));var exec=require(_0xe889('0x1'))['exec'];var logger=require(_0xe889('0x2'))('api');var util=require(_0xe889('0x3'));var BPromise=require(_0xe889('0x4'));var _=require(_0xe889('0x5'));function handleError(_0x3a638f,_0x459c41,_0x5acbcd){_0x459c41=_0x459c41||0x1f4;return function(_0x3c7a62){logger[_0xe889('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x5acbcd,_0x459c41,util['inspect'](_0x3c7a62,{'showHidden':![],'depth':null}));delete _0x3c7a62[_0xe889('0x7')];_0x3a638f[_0xe889('0x8')](_0x459c41)['send'](_0x3c7a62);};}exports['index']=function(_0x4ccc1e,_0x278601){return info[_0xe889('0x9')]()[_0xe889('0xa')](function(_0x416df2){return _0x278601[_0xe889('0x8')](0xc8)[_0xe889('0xb')](_0x416df2);})[_0xe889('0xc')](function(_0x1a1cdf){return _0x278601[_0xe889('0x8')](0x1f4)[_0xe889('0xb')](_0x1a1cdf);});};exports[_0xe889('0xd')]=function(_0x3eaaa3,_0x493dda){var _0x19b3a5=[_0xe889('0xe')];return new BPromise(function(_0x3b52a1,_0x1b808b){return exec(util[_0xe889('0xf')](_0xe889('0x10'),_0x3eaaa3[_0xe889('0x11')][_0xe889('0x12')]),function(_0x480f13,_0x36dc1f,_0x277b67){if(_0x480f13){return _0x1b808b(_0x480f13);}return _0x3b52a1(_0x36dc1f);});})[_0xe889('0xa')](function(_0x5db1f2){var _0x3546d4=![];var _0x3cc520=_0x5db1f2[_0xe889('0x13')](/\n/);for(var _0x54a0de=0x0,_0x1c32d8=_0x19b3a5[_0xe889('0x14')];_0x54a0de<_0x1c32d8,_0x3546d4===![];_0x54a0de+=0x1){if(_0x5db1f2['indexOf'](_0x19b3a5[_0x54a0de])>=0x0){_0x3546d4=!![];}}if(!_0x3546d4){throw new Error(util[_0xe889('0xf')](_0xe889('0x15'),_0x3eaaa3['params']['pid']));}process['kill'](_0x3eaaa3[_0xe889('0x11')][_0xe889('0x12')],_0xe889('0x16'));return _0x493dda[_0xe889('0x8')](0xc8)[_0xe889('0xb')]({'message':util[_0xe889('0xf')](_0xe889('0x17'),_0x3eaaa3[_0xe889('0x11')][_0xe889('0x12')])});})[_0xe889('0xc')](handleError(_0x493dda,null,_0xe889('0xd')));};