Here is my code and the output, it shows the right file to execute but it is not processing the file.
/* global mobicontrol */
var ip = null;
mobicontrol.network.activeNetwork.ipAddresses.forEach(ipInner => {
if (!ipInner.isLoopback && !ipInner.isLinkLocalAddress) {
var currentIp = ipInner.hostAddress;
const re = /^\d+\.\d+\.\d+.\d+$/;
var isIp4 = re.test(currentIp);
if (isIp4) {
ip = currentIp;
return;
}
}
});
var filename;
if (ip !== null) {
var split_it = ip.split(".");
var octet2 = ip[1];
var serverNumber = parseInt(octet2, 10);
switch (serverNumber) {
// each needs to represent the service center number and associated timezone
case 65: //ABI
case 64: //AMA
case 55: //AUS
case 26: //BHM
case 87: //BLG
case 47: //BTR
case 60: //CRP
case 41: //DFW
case 31: //DOT
case 69: //FTS
case 80: //FTW
case 90: //GAR
case 42: //HOU
case 28: //HSV
case 35: //JAC
case 79: //JBO
case 56: //JCK
case 78: //LAF
case 61: //LRD
case 70: //LRK
case 88: //LUB
case 59: //MCA
case 29: //MGM
filename = '/sdcard/TimeZones/Central_TimeZone.xml';
case 63: //ELP
filename = '/sdcard/TimeZones/Mountain_TimeZone.xml';
case 49: //RCO
filename = '/sdcard/TimeZones/Atlantic_TimeZone.xml';
default:
filename = '/sdcard/TimeZones/Eastern_TimeZone.xml';
}
} else {
mobicontrol.log.error("Could not find the machine's IP Address defaulting to Eastern.");
filename = '/sdcard/TimeZones/Eastern_TimeZone.xml';
}
mobicontrol.log.info('Found ' + filename + ' to sync.');
// Map the timezone to some configuration file to be downloaded.
//The time zone files will be synced prior to implementing this via soti file sync rule