6d10295819ebf40c7bd8bd8f35183ecd69e0c4dd
[motion2.git] / server / services / ami / trigger / script / index.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 _0xb2cb=['data3','render','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0xb2cb,0x131));var _0xbb2c=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xb2cb[_0x2080a3];return _0x8d7d17;};'use strict';var util=require('util');var sh=require(_0xbb2c('0x0'));var Mustache=require(_0xbb2c('0x1'));var logger=require(_0xbb2c('0x2'))(_0xbb2c('0x3'));exports[_0xbb2c('0x4')]=function(_0x4ee327,_0x5b616a){var _0x4944a1=_0x4ee327[_0xbb2c('0x5')]?_0x4ee327[_0xbb2c('0x5')]:_0xbb2c('0x6');var _0x49d064=_0x4ee327[_0xbb2c('0x7')]?Mustache[_0xbb2c('0x8')](_0x4ee327[_0xbb2c('0x7')],_0x5b616a):_0x5b616a;sh['exec'](_0x49d064,function(_0x2c1876,_0x4ccede,_0x8bc853){if(_0x2c1876!==0x0){logger[_0xbb2c('0x9')](util[_0xbb2c('0xa')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x4944a1,_0x49d064,_0x2c1876,_0x8bc853));}else{logger[_0xbb2c('0xb')](util[_0xbb2c('0xa')](_0xbb2c('0xc'),_0x4944a1,_0x49d064,_0x4ccede));}});};