Built motion from commit 65070aa.|0.0.108
[motion.git] / server / config / ami / trunk.js
1 var _0x27f1=["\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","\x61\x63\x74\x69\x76\x65","\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","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x44\x65\x6C\x65\x74\x65","\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","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x63\x6C\x6F\x6E\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x5B\x25\x73\x5D\x0A","\x6E\x61\x6D\x65","\x66\x6F\x72\x6D\x61\x74","\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","\x72\x65\x67\x69\x73\x74\x72\x79","\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"];var TrunkModel=require(_0x27f1[1])[_0x27f1[0]];var fs=require(_0x27f1[2]);var util=require(_0x27f1[3]);var path=require(_0x27f1[4]);var config=require(_0x27f1[5]);var _=require(_0x27f1[6]);function Trunk(_0x4377x8){console[_0x27f1[8]](_0x27f1[7]);TrunkModel[_0x27f1[10]](function(_0x4377x9){if(_0x4377x9[_0x27f1[9]]){trunksRewrite(_0x4377x9,_0x4377x8,false)}});TrunkModel[_0x27f1[15]](function(_0x4377x9){if(!_0x4377x9[_0x27f1[12]](_0x27f1[11])&&!_0x4377x9[_0x27f1[12]](_0x27f1[13])&&!_0x4377x9[_0x27f1[12]](_0x27f1[14])){trunksRewrite(_0x4377x9,_0x4377x8,false)}});TrunkModel[_0x27f1[16]](function(_0x4377x9){trunksRewrite(_0x4377x9,_0x4377x8,true)})}Trunk[_0x27f1[18]][_0x27f1[17]]=function(_0x4377xa){return TrunkModel[_0x27f1[24]]({status:_0x4377xa[_0x27f1[11]]},{where:{defaultuser:_0x4377xa[_0x27f1[21]],host:_0x4377xa[_0x27f1[22]],active:true,$and:[{registry:{$ne:_0x27f1[23]}},{registry:{$ne:null}}]},individualHooks:true})[_0x27f1[20]](function(_0x4377xb){console[_0x27f1[8]](_0x27f1[19],_0x4377xb)})};Trunk[_0x27f1[18]][_0x27f1[25]]=function(_0x4377xa){return TrunkModel[_0x27f1[24]]({peerstatus:_0x4377xa[_0x27f1[13]]},{where:{name:_0x4377xa[_0x27f1[29]][_0x27f1[28]](_0x27f1[27])[1]},individualHooks:true})[_0x27f1[20]](function(_0x4377xb){console[_0x27f1[8]](_0x27f1[26],_0x4377xb)})};function trunksRewrite(_0x4377x9,_0x4377x8,_0x4377xd){var _0x4377xe=_0x27f1[23];var _0x4377xf=_0x27f1[23];var _0x4377x10=_0x27f1[30];if(!_0x4377xd){var _0x4377x11=_[_0x27f1[32]](_0x4377x9[_0x27f1[31]]);delete _0x4377x11[_0x27f1[33]];delete _0x4377x11[_0x27f1[14]];delete _0x4377x11[_0x27f1[9]];delete _0x4377x11[_0x27f1[11]];_0x4377xe+=util[_0x27f1[36]](_0x27f1[34],_0x4377x11[_0x27f1[35]]);if(_0x4377x11[_0x27f1[37]]){_0x4377xe+=util[_0x27f1[36]](_0x27f1[38],_0x4377x11[_0x27f1[37]]);delete _0x4377x11[_0x27f1[37]]};for(var _0x4377x12 in _0x4377x11){if(_0x4377x11[_0x4377x12]){switch(_0x4377x12){case _0x27f1[42]:var _0x4377x13=_0x4377x11[_0x4377x12][_0x27f1[28]](_0x27f1[39]);_0x4377x13[_0x27f1[41]](function(_0x4377x14){_0x4377xe+=util[_0x27f1[36]](_0x27f1[40],_0x4377x12,_0x4377x14)});break;default:_0x4377xe+=util[_0x27f1[36]](_0x27f1[40],_0x4377x12,_0x4377x11[_0x4377x12])}}};if(_0x4377x11[_0x27f1[43]]){_0x4377xf+=util[_0x27f1[36]](_0x4377x10,_0x4377x11[_0x27f1[43]])}};return TrunkModel[_0x27f1[55]]({where:{name:{$ne:_0x4377x9[_0x27f1[35]]},active:true}})[_0x27f1[54]](function(_0x4377x15){var _0x4377x16=_[_0x27f1[44]](_0x4377x15,_0x27f1[31]);_0x4377x16[_0x27f1[41]](function(_0x4377x17){delete _0x4377x17[_0x27f1[33]];delete _0x4377x17[_0x27f1[14]];delete _0x4377x17[_0x27f1[9]];delete _0x4377x17[_0x27f1[11]];_0x4377xe+=util[_0x27f1[36]](_0x27f1[34],_0x4377x17[_0x27f1[35]]);if(_0x4377x17[_0x27f1[37]]){_0x4377xe+=util[_0x27f1[36]](_0x27f1[38],_0x4377x17[_0x27f1[37]]);delete _0x4377x17[_0x27f1[37]]};for(var _0x4377x12 in _0x4377x17){if(_0x4377x17[_0x4377x12]){switch(_0x4377x12){case _0x27f1[42]:var _0x4377x13=_0x4377x17[_0x4377x12][_0x27f1[28]](_0x27f1[39]);_0x4377x13[_0x27f1[41]](function(_0x4377x14){_0x4377xe+=util[_0x27f1[36]](_0x27f1[40],_0x4377x12,_0x4377x14)});break;default:_0x4377xe+=util[_0x27f1[36]](_0x27f1[40],_0x4377x12,_0x4377x17[_0x4377x12])}}};if(_0x4377x17[_0x27f1[43]]){_0x4377xf+=util[_0x27f1[36]](_0x4377x10,_0x4377x17[_0x27f1[43]])}});fs[_0x27f1[53]](path[_0x27f1[47]](config[_0x27f1[45]],_0x27f1[46]),_0x4377xe,{flags:_0x27f1[48],mode:parseInt(_0x27f1[49],8)},function(_0x4377xb){if(_0x4377xb){throw _0x4377xb};console[_0x27f1[8]](_0x27f1[50]);fs[_0x27f1[53]](path[_0x27f1[47]](config[_0x27f1[45]],_0x27f1[51]),_0x4377xf,{flags:_0x27f1[48],mode:parseInt(_0x27f1[49],8)},function(_0x4377xb){if(_0x4377xb){throw _0x4377xb};reload(_0x4377x8);console[_0x27f1[8]](_0x27f1[52])})})})[_0x27f1[20]](function(_0x4377xb){console[_0x27f1[8]](_0x4377xb)})}function reload(_0x4377x8){_0x4377x8[_0x27f1[58]]({Action:_0x27f1[56]},function(_0x4377xb,_0x4377x19){if(_0x4377xb){console[_0x27f1[57]](_0x4377xb)}else {console[_0x27f1[8]](_0x4377x19)}})}module[_0x27f1[59]]=Trunk