Built motion from commit 14c9826.|0.0.145
[motion.git] / server / config / ami / trunk.js
1 var _0x3e98=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x54\x72\x75\x6E\x6B","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x66\x73","\x75\x74\x69\x6C","\x70\x61\x74\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x6C\x6F\x64\x61\x73\x68","\x54\x72\x75\x6E\x6B\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x6D\x65\x73\x73\x61\x67\x65","\x61\x63\x74\x69\x76\x65","\x54\x72\x75\x6E\x6B\x2E\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x73\x74\x61\x74\x75\x73","\x63\x68\x61\x6E\x67\x65\x64","\x70\x65\x65\x72\x73\x74\x61\x74\x75\x73","\x54\x72\x75\x6E\x6B\x2E\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x54\x72\x75\x6E\x6B\x2E\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x65\x76\x74","\x6F\x6E","\x73\x74\x61\x74\x75\x73\x55\x70\x64\x61\x74\x65","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x54\x72\x75\x6E\x6B\x20\x73\x74\x61\x74\x75\x73\x20\x75\x70\x64\x61\x74\x65\x20\x65\x72\x72\x6F\x72\x3A","\x63\x61\x74\x63\x68","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x64\x6F\x6D\x61\x69\x6E","","\x75\x70\x64\x61\x74\x65","\x70\x65\x65\x72\x73\x74\x61\x74\x75\x73\x55\x70\x64\x61\x74\x65","\x54\x72\x75\x6E\x6B\x20\x70\x65\x65\x72\x73\x74\x61\x74\x75\x73\x20\x75\x70\x64\x61\x74\x65\x20\x65\x72\x72\x6F\x72\x3A","\x2F","\x73\x70\x6C\x69\x74","\x70\x65\x65\x72","\x72\x65\x67\x69\x73\x74\x65\x72\x20\x3D\x3E\x20\x25\x73\x0A","\x63\x6C\x6F\x6E\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x72\x65\x67\x69\x73\x74\x72\x79","\x66\x6F\x72\x6D\x61\x74","\x5B\x25\x73\x5D\x0A","\x6E\x61\x6D\x65","\x6F\x74\x68\x65\x72\x46\x69\x65\x6C\x64\x73","\x25\x73\x0A","\x3B","\x25\x73\x3D\x25\x73\x0A","\x66\x6F\x72\x45\x61\x63\x68","\x61\x6C\x6C\x6F\x77","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x6D\x61\x70","\x61\x73\x74\x65\x72\x69\x73\x6B\x43\x6F\x6E\x66","\x73\x69\x70\x5F\x78\x63\x61\x6C\x6C\x79\x5F\x74\x72\x75\x6E\x6B\x73\x2E\x63\x6F\x6E\x66","\x6A\x6F\x69\x6E","\x77","\x30\x37\x37\x37","\x54\x72\x75\x6E\x6B\x73\x20\x66\x69\x6C\x65\x20\x73\x61\x76\x65\x64\x21","\x73\x69\x70\x5F\x78\x63\x61\x6C\x6C\x79\x5F\x72\x65\x67\x69\x73\x74\x65\x72\x73\x2E\x63\x6F\x6E\x66","\x54\x72\x75\x6E\x6B\x73\x20\x72\x65\x67\x69\x73\x74\x65\x72\x20\x66\x69\x6C\x65\x20\x73\x61\x76\x65\x64\x21","\x77\x72\x69\x74\x65\x46\x69\x6C\x65","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6C\x6C","\x52\x65\x6C\x6F\x61\x64","\x65\x72\x72\x6F\x72","\x61\x63\x74\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x73"];_0x3e98[0];var TrunkModel=require(_0x3e98[2])[_0x3e98[1]];var fs=require(_0x3e98[3]);var util=require(_0x3e98[4]);var path=require(_0x3e98[5]);var config=require(_0x3e98[6]);var _=require(_0x3e98[7]);function Trunk(_0xc221x8){console[_0x3e98[9]](_0x3e98[8]);process[_0x3e98[19]](_0x3e98[10],function(_0xc221x9){switch(_0xc221x9[_0x3e98[18]]){case _0x3e98[12]:if(_0xc221x9[_0x3e98[11]]){trunksRewrite(_0xc221x9,_0xc221x8,false)};break;case _0x3e98[16]:if(!_0xc221x9[_0x3e98[14]][_0x3e98[13]]&& !_0xc221x9[_0x3e98[14]][_0x3e98[15]]){trunksRewrite(_0xc221x9,_0xc221x8,false)};break;case _0x3e98[17]:trunksRewrite(_0xc221x9,_0xc221x8,true);break;default:}})}Trunk[_0x3e98[21]][_0x3e98[20]]= function(_0xc221xa){return TrunkModel[_0x3e98[27]]({status:_0xc221xa[_0x3e98[13]]},{where:{defaultuser:_0xc221xa[_0x3e98[24]],host:_0xc221xa[_0x3e98[25]],active:true,$and:[{registry:{$ne:_0x3e98[26]}},{registry:{$ne:null}}]},individualHooks:true,raw:true})[_0x3e98[23]](function(_0xc221xb){console[_0x3e98[9]](_0x3e98[22],_0xc221xb)})};Trunk[_0x3e98[21]][_0x3e98[28]]= function(_0xc221xa){return TrunkModel[_0x3e98[27]]({peerstatus:_0xc221xa[_0x3e98[15]]},{where:{name:_0xc221xa[_0x3e98[32]][_0x3e98[31]](_0x3e98[30])[1]},individualHooks:true,raw:true})[_0x3e98[23]](function(_0xc221xb){console[_0x3e98[9]](_0x3e98[29],_0xc221xb)})};function trunksRewrite(_0xc221x9,_0xc221x8,_0xc221xd){var _0xc221xe=_0x3e98[26];var _0xc221xf=_0x3e98[26];var _0xc221x10=_0x3e98[33];if(!_0xc221xd&& _0xc221x9[_0x3e98[11]]){var _0xc221x11=_[_0x3e98[34]](_0xc221x9);delete _0xc221x11[_0x3e98[35]];delete _0xc221x11[_0x3e98[36]];delete _0xc221x11[_0x3e98[11]];delete _0xc221x11[_0x3e98[13]];delete _0xc221x11[_0x3e98[15]];delete _0xc221x11[_0x3e98[18]];delete _0xc221x11[_0x3e98[14]];if(_0xc221x11[_0x3e98[37]]){_0xc221xf+= util[_0x3e98[38]](_0xc221x10,_0xc221x11[_0x3e98[37]])};delete _0xc221x11[_0x3e98[37]];_0xc221xe+= util[_0x3e98[38]](_0x3e98[39],_0xc221x11[_0x3e98[40]]);if(_0xc221x11[_0x3e98[41]]){_0xc221xe+= util[_0x3e98[38]](_0x3e98[42],_0xc221x11[_0x3e98[41]]);delete _0xc221x11[_0x3e98[41]]};for(var _0xc221x12 in _0xc221x11){if(_0xc221x11[_0xc221x12]){switch(_0xc221x12){case _0x3e98[46]:var _0xc221x13=_0xc221x11[_0xc221x12][_0x3e98[31]](_0x3e98[43]);_0xc221x13[_0x3e98[45]](function(_0xc221x14){_0xc221xe+= util[_0x3e98[38]](_0x3e98[44],_0xc221x12,_0xc221x14)});break;default:_0xc221xe+= util[_0x3e98[38]](_0x3e98[44],_0xc221x12,_0xc221x11[_0xc221x12])}}}};return TrunkModel[_0x3e98[59]]({where:{name:{$ne:_0xc221x9[_0x3e98[40]]},active:true}})[_0x3e98[58]](function(_0xc221x15){var _0xc221x16=_[_0x3e98[48]](_0xc221x15,_0x3e98[47]);_0xc221x16[_0x3e98[45]](function(_0xc221x17){delete _0xc221x17[_0x3e98[35]];delete _0xc221x17[_0x3e98[36]];delete _0xc221x17[_0x3e98[11]];delete _0xc221x17[_0x3e98[13]];delete _0xc221x17[_0x3e98[15]];if(_0xc221x17[_0x3e98[37]]){_0xc221xf+= util[_0x3e98[38]](_0xc221x10,_0xc221x17[_0x3e98[37]])};delete _0xc221x17[_0x3e98[37]];_0xc221xe+= util[_0x3e98[38]](_0x3e98[39],_0xc221x17[_0x3e98[40]]);if(_0xc221x17[_0x3e98[41]]){_0xc221xe+= util[_0x3e98[38]](_0x3e98[42],_0xc221x17[_0x3e98[41]]);delete _0xc221x17[_0x3e98[41]]};for(var _0xc221x12 in _0xc221x17){if(_0xc221x17[_0xc221x12]){switch(_0xc221x12){case _0x3e98[46]:var _0xc221x13=_0xc221x17[_0xc221x12][_0x3e98[31]](_0x3e98[43]);_0xc221x13[_0x3e98[45]](function(_0xc221x14){_0xc221xe+= util[_0x3e98[38]](_0x3e98[44],_0xc221x12,_0xc221x14)});break;default:_0xc221xe+= util[_0x3e98[38]](_0x3e98[44],_0xc221x12,_0xc221x17[_0xc221x12])}}}});fs[_0x3e98[57]](path[_0x3e98[51]](config[_0x3e98[49]],_0x3e98[50]),_0xc221xe,{flags:_0x3e98[52],mode:parseInt(_0x3e98[53],8)},function(_0xc221xb){if(_0xc221xb){throw _0xc221xb};console[_0x3e98[9]](_0x3e98[54]);fs[_0x3e98[57]](path[_0x3e98[51]](config[_0x3e98[49]],_0x3e98[55]),_0xc221xf,{flags:_0x3e98[52],mode:parseInt(_0x3e98[53],8)},function(_0xc221xb){if(_0xc221xb){throw _0xc221xb};reload(_0xc221x8);console[_0x3e98[9]](_0x3e98[56])})})})[_0x3e98[23]](function(_0xc221xb){console[_0x3e98[9]](_0xc221xb)})}function reload(_0xc221x8){_0xc221x8[_0x3e98[62]]({Action:_0x3e98[60]},function(_0xc221xb,_0xc221x19){if(_0xc221xb){console[_0x3e98[61]](_0xc221xb)}else {console[_0x3e98[9]](_0xc221x19)}})}module[_0x3e98[63]]= Trunk