Built motion from commit (unavailable).|2.5.4
[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 _0xaf1b=['api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','send','getAllData','status','catch','json','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','length','kill','SIGINT','systeminformation','child_process','exec','../../config/logger'];(function(_0x10fa43,_0x1f735b){var _0x256f4f=function(_0x3816f0){while(--_0x3816f0){_0x10fa43['push'](_0x10fa43['shift']());}};_0x256f4f(++_0x1f735b);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x15f7f5,_0x2254d3){_0x15f7f5=_0x15f7f5-0x0;var _0x2887d0=_0xaf1b[_0x15f7f5];return _0x2887d0;};'use strict';var info=require(_0xbaf1('0x0'));var exec=require(_0xbaf1('0x1'))[_0xbaf1('0x2')];var logger=require(_0xbaf1('0x3'))(_0xbaf1('0x4'));var util=require(_0xbaf1('0x5'));var BPromise=require(_0xbaf1('0x6'));var _=require(_0xbaf1('0x7'));function handleError(_0x461ffb,_0x3fe8f0,_0x156a67){_0x3fe8f0=_0x3fe8f0||0x1f4;return function(_0x97aab){logger[_0xbaf1('0x8')](_0xbaf1('0x9'),_0x156a67,_0x3fe8f0,util['inspect'](_0x97aab,{'showHidden':![],'depth':null}));delete _0x97aab[_0xbaf1('0xa')];_0x461ffb['status'](_0x3fe8f0)[_0xbaf1('0xb')](_0x97aab);};}exports['index']=function(_0x2052c8,_0x3723ae){return info[_0xbaf1('0xc')]()['then'](function(_0x222756){return _0x3723ae[_0xbaf1('0xd')](0xc8)['json'](_0x222756);})[_0xbaf1('0xe')](function(_0x578f20){return _0x3723ae[_0xbaf1('0xd')](0x1f4)[_0xbaf1('0xf')](_0x578f20);});};exports[_0xbaf1('0x10')]=function(_0x1c1891,_0x2a9ebf){var _0x36ec1c=['components/import/cm'];return new BPromise(function(_0x493f3f,_0x322058){return exec(util[_0xbaf1('0x11')](_0xbaf1('0x12'),_0x1c1891[_0xbaf1('0x13')][_0xbaf1('0x14')]),function(_0x1097d6,_0x177599,_0x4c31a3){if(_0x1097d6){return _0x322058(_0x1097d6);}return _0x493f3f(_0x177599);});})[_0xbaf1('0x15')](function(_0x173cb6){var _0xb9ac72=![];var _0x342c11=_0x173cb6[_0xbaf1('0x16')](/\n/);for(var _0x25458f=0x0,_0x199252=_0x36ec1c[_0xbaf1('0x17')];_0x25458f<_0x199252,_0xb9ac72===![];_0x25458f+=0x1){if(_0x173cb6['indexOf'](_0x36ec1c[_0x25458f])>=0x0){_0xb9ac72=!![];}}if(!_0xb9ac72){throw new Error(util[_0xbaf1('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1c1891[_0xbaf1('0x13')][_0xbaf1('0x14')]));}process[_0xbaf1('0x18')](_0x1c1891[_0xbaf1('0x13')]['pid'],_0xbaf1('0x19'));return _0x2a9ebf['status'](0xc8)[_0xbaf1('0xf')]({'message':util[_0xbaf1('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x1c1891[_0xbaf1('0x13')][_0xbaf1('0x14')])});})[_0xbaf1('0xe')](handleError(_0x2a9ebf,null,_0xbaf1('0x10')));};