Commit bd572f6c authored by Eric - kg6wxc's avatar Eric - kg6wxc
Browse files

Bugfixes/Changes

Removed an errant "echo" that would cause output in "silent" mode.

When the polling script parsed through the interfaces looking for the
wlan MAC address and ip (and the LAN ip) it always had issues with the
different versions of the json file on different firmwares.
I think this has finally been solved.
The polling script should pull the proper info from even a 3.15.1.0 node
now and if those nodes have location info they should now appear on the
map too.
The admins of those devices should be strongly reminded to update!!

I mistakenly removed the red and green dot from the status area of the
admin page. They are restored now.

Parallel node polling will work now, but it is not recommended on large
networks, as there is still no control over how many scripts are
spawned. Small networks of should be just fine.
(this has been tested many times on a network of 20-30 (sometimes 100's)
with no issues)
Use at your own risk though.

New warnings in "Test Mode" to alert when a nodes location has been
"fixed" or not. It's very noticable now.

Some general clean up/typo fixing and removal of things that were long
due for removal.

fixed some file attributes.

Added some things to be used in the near future but are not done yet.

73
parent fb51e8ea
......@@ -64,6 +64,7 @@ $mtimeStart = microtime(true);
******/
//Increase PHP memory limit to 128M (you may need more if you are connected to a "Mega Mesh" :) )
//this should be moved to the ini file maybe
ini_set('memory_limit', '128M');
/***********************************************************************
......@@ -162,16 +163,9 @@ if ($do_sql) {
if ($TEST_MODE_NO_SQL) {
wxc_echoWithColor("SQL Server access disabled!", "red");
echo "\n";
//echo "\033[31mSQL Server access disabled!\033[0m\n\n";
}
}
//if ($do_sql) {
// wxc_checkDB();
//}
//This controls when certain parts of the script run.
//We check the DB for the time we last checked and only run if we need to.
//intervals are now controled via the ini file.
......@@ -248,10 +242,7 @@ if ($do_sql) {
wxc_removeIgnoredNodes();
}
$resolvedHostname = "";
$nodeLocationFixed = 0;
$node = "";
$noPort9090 = 0;
if ($getNodeInfo) {
//this section is what goes out to each node on the mesh and asks for it's info
//this is really the heart of the mapping system, without this (and the sysinfo.json file),
......@@ -294,6 +285,7 @@ if ($getNodeInfo) {
//copy to new var name (I dont feel like editing it all right now)
$nodeName = $ipAddr;
if ($USER_SETTINGS['node_polling_parallel']) {
shell_exec("php $INCLUDE_DIR/scripts/parallel_node_polling.php $ipAddr $do_sql 0 > /dev/null 2>/dev/null &");
//for($count = 1; $count <= 20; $count++) {
// $ipAddrList .= $ipAddr . "\n";
//}
......@@ -307,10 +299,9 @@ if ($getNodeInfo) {
}else {
//get the sysinfo.json file from the node being polled.
$sysinfoJson = @file_get_contents("http://$ipAddr:8080/cgi-bin/sysinfo.json?services_local=1"); //get the .json file
$jsonFetchSuccess = 1;
//check if we got anything back, if not, try to tell why.
if($sysinfoJson === FALSE) {
$jsonFetchSuccess = 0;
$error = error_get_last();
wxc_checkErrorMessage($error, $nodeName);
//just skip to the next IP since there was an error
......@@ -324,8 +315,9 @@ if ($getNodeInfo) {
if (!$result || empty($result)) {
continue;
}
//first let's see what node we are dealing with
//$node = $GLOBALS['node'] = $result['node'];
//sometimes this might be blank, catch it
$node = $result['node'];
//if it's nothing other than the node name, it's some other device
......@@ -350,12 +342,14 @@ if ($getNodeInfo) {
//if lat || lon is blank, make it "0"
//this was sometimes screwing up the SQL writing function
//but not always of course.
if ($result['lat'] == "") {
if (empty($result['lat'])) {
//if ($result['lat'] == "") {
$lat = 0.0;
}else {
$lat = $result['lat'];
}
if ($result['lon'] == "") {
if (empty($result['lon'])) {
//if ($result['lon'] == "") {
$lon = 0.0;
}else {
$lon = $result['lon'];
......@@ -370,20 +364,27 @@ if ($getNodeInfo) {
$channel = $result['channel'];
$firmware_mfg = $result['firmware_mfg'];
//had to screen scrape the status page for this info before (or use the evil port 9090!)
//had to screen scrape the status page for this info before
//which required an additional call to the node
//now it is here! :)
$uptime = "NotAvailable";
$loadavg = "NotAvailable";
if (version_compare($api_version, "1.2", ">=")) {
$uptime = $result['sysinfo']['uptime'];
$loadavg = serialize($result['sysinfo']['loads']); // <-- this is an array that has been serialized!!
if (isset($result['sysinfo']['uptime'])) {
$uptime = $result['sysinfo']['uptime'];
}
if (isset($result['sysinfo']['loads'])) {
$loadavg = serialize($result['sysinfo']['loads']); // <-- this is an array that has been serialized!!
}
}
//local service listing are now in the json file!! yay!
//this required evil port 9090 before
//this required an additional call to port 9090 on the node before
$services = "NotAvailable";
if (version_compare($api_version, "1.3", ">=")) {
$services = serialize($result['services_local']); // <-- this is an array that has been serialized!
if (isset($result['services_local'])) {
$services = serialize($result['services_local']); // <-- this is an array that has been serialized!
}
}
//this only seems to affect some nodes.
......@@ -407,41 +408,29 @@ if ($getNodeInfo) {
}
//
// This should catch some of those pesky ones
// what a fricken nightmare... jeez
// finally!
//
if ($result['api_version'] == "1.0" && $infInfo['name'] == $eth && $interface !== $eth) {
$lan_ip = $infInfo['ip'];
}
//elseif ($result['api_version'] == "1.0" && $infInfo['name'] == "eth0.0") {
// $lan_ip = $infInfo['ip'];
//}
elseif ($result['api_version'] == "1.0" && $infInfo['name'] == "wlan0" && $interface !== "wlan0") {
$wlan_ip = $infInfo['ip'];
$wifi_mac_address = $infInfo['mac'];
}elseif ($result['api_version'] == "1.0" && $interface == $eth) {
$lan_ip = $infInfo['ip'];
}
//elseif ($result['api_version'] == "1.0" && $interface == "eth0.0") {
// $lan_ip = $infInfo['ip'];
//}
elseif ($result['api_version'] == "1.0" && $interface == "wlan0") {
$wlan_ip = $infInfo['ip'];
$wifi_mac_address = $infInfo['mac'];
}elseif (version_compare($result['api_version'], "1.0", ">")) {
if ($infInfo['name'] == $eth) { // error with KK9DS on $name (undefined index)
if (is_numeric($interface)) {
if ($infInfo['name'] == $eth) {
if (isset($infInfo['ip'])) {
if ($infInfo['ip'] == "none") {
if ($infInfo['ip'] == 'none') {
$lan_ip = "NotAvailable";
}else {
$lan_ip = $infInfo['ip']; //error with ke6upi here on $ip (undefinded index)
$lan_ip = $infInfo['ip'];
}
}elseif (!isset($infInfo['ip'])) {
}else {
$lan_ip = "NotAvailable";
}
}elseif ($infInfo['name'] == 'wlan0') {
$wlan_ip = $infInfo['ip'];
$wifi_mac_address = $infInfo['mac'];
}
if ($infInfo['name'] == "wlan0") {
}else {
if ($interface == $eth) {
$lan_ip = $infInfo['ip'];
}elseif ($interface == 'wlan0') {
$wlan_ip = $infInfo['ip'];
$wifi_mac_address = $infInfo['mac']; //added to fix MAC address issue, caught by Mark, N2MH 14 March 2017.
$wifi_mac_address = $infInfo['mac'];
}
}
}
......@@ -503,7 +492,7 @@ if ($getNodeInfo) {
//}else {
//
//}
echo "\n";
//echo "\n";
}
if ($do_sql) {
......@@ -655,6 +644,12 @@ if ($getNodeInfo) {
}
}
}
if ($testNodePolling) {
wxc_echoWithColor('****This nodes location has been "fixed" in the Database!****', 'alert');
echo "\n";
wxc_echoWithColor('****It will not update from polling if the location changes****', 'alert');
echo "\n";
}
}else {
//check if we have changed node name and have the same hardware.
//the database itself should handle if there is new hardware with the same node name.
......@@ -695,7 +690,6 @@ if ($getNodeInfo) {
$loadavg = NULL;
$services = NULL;
$sysinfoJson = NULL;
//$olsrdInfo = NULL;
}
}
}
......@@ -746,6 +740,12 @@ if ($getLinkInfo) {
if ($do_sql) { //put the data into SQL, if we can.
wxc_putMySQL("INSERT INTO $sql_db_tbl_topo(node, linkto, cost) VALUES('$nodeName', '$linktoName', '$cost')");
//quick hacks to remove/change junk
wxc_putMySQL("delete from $sql_db_tbl_topo where node is NULL and linkto is NULL");
// wxc_putMySql("update topology set nodelat = 0 where nodelat is NULL");
// wxc_putMySql("update topology set nodelon = 0 where nodelon is NULL");
// wxc_putMySql("update topology set linklat = 0 where linklat is NULL");
// wxc_putMySql("update topology set linklon = 0 where linklon is NULL");
}
if ($testLinkInfo) { //output to screen if we are in "test mode".
......
......@@ -1111,7 +1111,8 @@ function show_MapMarkerDetails($numNodes, $numLinks, $numMarkers, $numNodesTotal
"KG6WXC in Oct 2016" .'\n' .
"With later contributions from:" . '\n' .
"N2MH and K6GSE" . '\n' .
"Official testing Guinea Pig: N7QJK\'>KG6WXC</a>&nbsp;|&nbsp;';\n";
"Official Testing Guinea Pig:" . '\n' .
"N7QJK\'>KG6WXC</a>&nbsp;|&nbsp;';\n";
$Content .= "MapAttribution = '<a href=http://leafletjs.com title=\'" .
"Map data &copy; by OpenStreetMap (http://openstreetmap.org) with contributions from:" . '\n' .
......@@ -1155,41 +1156,6 @@ map.fullscreenControl.setPosition('verticalcenterleft');
EOD;
if (!isset($GLOBALS['hide_admin']) == "1") {
$Content .= <<< EOD
//admin icon (the gears)
L.Control.Admin = L.Control.extend({
options: {
position: 'verticalcenterleft'
},
onAdd: function(map) {
var adminControl = L.DomUtil.create('div', 'leaflet-control-custom leaflet-bar');
adminControl.style.backgroundColor = 'white';
//adminControl.content = "\F013";
//adminControl.font-family = "FontAwesome";
//adminControl.style.background = "fa-cog";
adminControl.style.width = '30px';
adminControl.style.height = '30px';
adminControl.title = 'Admin';
var link = L.DomUtil.create('a', 'leaflet-bar-part leaflet-bar-part-single', adminControl);
var gear = L.DomUtil.create('span', 'fa fa-cogs', link);
gear.style.fontSize = '15px';
adminControl.onclick = function() {
//alert('you clicked it');
window.location = "admin/admin.php";
}
return adminControl;
}
});
L.control.admin = function(opts) {
return new L.Control.Admin(opts);
}
/*
*admin control button
*/
L.control.admin().addTo(map);
EOD;
}
$Content .= <<< EOD
//the ruler
var rulerOptions = {position: 'verticalcenterleft',
......@@ -1249,6 +1215,41 @@ var contents = "";
EOD;
if (!isset($GLOBALS['hide_admin']) == "1") {
$Content .= <<< EOD
//admin icon (the gears)
L.Control.Admin = L.Control.extend({
options: {
position: 'verticalcenterleft'
},
onAdd: function(map) {
var adminControl = L.DomUtil.create('div', 'leaflet-control-custom leaflet-bar');
adminControl.style.backgroundColor = 'white';
//adminControl.content = "\F013";
//adminControl.font-family = "FontAwesome";
//adminControl.style.background = "fa-cog";
adminControl.style.width = '30px';
adminControl.style.height = '30px';
adminControl.title = 'Admin';
var link = L.DomUtil.create('a', 'leaflet-bar-part leaflet-bar-part-single', adminControl);
var gear = L.DomUtil.create('span', 'fa fa-cogs', link);
gear.style.fontSize = '15px';
adminControl.onclick = function() {
//alert('you clicked it');
window.location = "admin/admin.php";
}
return adminControl;
}
});
L.control.admin = function(opts) {
return new L.Control.Admin(opts);
}
/*
*admin control button
*/
L.control.admin().addTo(map);
EOD;
}
// $help_msg = file_get_contents('../webpage/help_msg.html');
// $Content .= "L.Control.slideMenu(\"" . $help_msg . "\").addTo(map);\n";
......
......@@ -46,21 +46,28 @@ $sql_db_tbl_node = $USER_SETTINGS['sql_db_tbl_node'];
$sql_db_tbl_topo = $USER_SETTINGS['sql_db_tbl_topo'];
$sysinfoJson = @file_get_contents("http://$ipAddr:8080/cgi-bin/sysinfo.json"); //get the .json file
$jsonFetchSuccess = 1;
if($sysinfoJson === FALSE) {
$jsonFetchSuccess = 0;
$error = error_get_last();
wxc_checkErrorMessage($error, $ipAddr);
//just skip to the next IP since there was an error
continue;
//just exit since there was an error
//when running in parallel mode you wont see this
//this script can be used to "target" a node and see what it returns tho
if ($testNodePolling) {
wxc_echoWithColor("There was an error retreiving the json file for: $ipAddr\n");
}
exit();
}else {
//node is there, get all the info we can
//get all the data from the json file and decode it
$result = json_decode($sysinfoJson,true);
//if there's nothing really there just skip to the next IP
//if there's nothing really there just exit
//this is the parallel script!
if (!$result || empty($result)) {
continue;
if ($testNodePolling) {
wxc_echoWithColor("The json file is empty for node: $ipAddr\n");
}
exit();
}
//first let's see what node we are dealing with
......@@ -77,7 +84,12 @@ if($sysinfoJson === FALSE) {
if ($result['node'] && $result['lat'] == "" && $result['lon'] == "" && $result['ssid'] == ""
&& $result['model'] == "" && $result['firmware_mfg'] == ""
&& $result['api_version'] == "") {
continue;
//just exit since this is junk
//this is the parallel script!
if ($testNodePolling) {
wxc_echoWithColor("This is probably some linux device running OLSR: " . $result['node'] . "\n");
}
exit();
}
//save json data to some variables
......@@ -89,12 +101,14 @@ if($sysinfoJson === FALSE) {
//if lat || lon is blank, make it "0"
//this was sometimes screwing up the SQL writing function
//but not always of course.
if ($result['lat'] == "") {
if (empty($result['lat'])) {
//if ($result['lat'] == "") {
$lat = 0.0;
}else {
$lat = $result['lat'];
}
if ($result['lon'] == "") {
if (empty($result['lon'])) {
//if ($result['lon'] == "") {
$lon = 0.0;
}else {
$lon = $result['lon'];
......@@ -109,20 +123,25 @@ if($sysinfoJson === FALSE) {
$channel = $result['channel'];
$firmware_mfg = $result['firmware_mfg'];
//had to screen scrape the status page for this info before (or use the evil port 9090!)
//had to screen scrape the status page for this info before
//now it is here! :)
$uptime = "NotAvailable";
$loadavg = "NotAvailable";
if (version_compare($api_version, "1.2", ">=")) {
$uptime = $result['sysinfo']['uptime'];
$loadavg = serialize($result['sysinfo']['loads']); // <-- this is an array that has been serialized!!
if (isset($result['sysinfo']['uptime'])) {
$uptime = $result['sysinfo']['uptime'];
}
if (isset($result['sysinfo']['loads'])) {
$loadavg = serialize($result['sysinfo']['loads']); // <-- this is an array that has been serialized!!
}
}
//local service listing are now in the json file!! yay!
//this required evil port 9090 before
$services = "NotAvailable";
if (version_compare($api_version, "1.3", ">=")) {
$services = serialize($result['services_local']); // <-- this is an array that has been serialized!
if (isset($result['services_local'])) {
$services = serialize($result['services_local']); // <-- this is an array that has been serialized!
}
}
//this only seems to affect some nodes.
......@@ -146,41 +165,29 @@ if($sysinfoJson === FALSE) {
}
//
// This should catch some of those pesky ones
// what a fricken nightmare... jeez
// finally!
//
if ($result['api_version'] == "1.0" && $infInfo['name'] == $eth && $interface !== $eth) {
$lan_ip = $infInfo['ip'];
}
//elseif ($result['api_version'] == "1.0" && $infInfo['name'] == "eth0.0") {
// $lan_ip = $infInfo['ip'];
//}
elseif ($result['api_version'] == "1.0" && $infInfo['name'] == "wlan0" && $interface !== "wlan0") {
$wlan_ip = $infInfo['ip'];
$wifi_mac_address = $infInfo['mac'];
}elseif ($result['api_version'] == "1.0" && $interface == $eth) {
$lan_ip = $infInfo['ip'];
}
//elseif ($result['api_version'] == "1.0" && $interface == "eth0.0") {
// $lan_ip = $infInfo['ip'];
//}
elseif ($result['api_version'] == "1.0" && $interface == "wlan0") {
$wlan_ip = $infInfo['ip'];
$wifi_mac_address = $infInfo['mac'];
}elseif (version_compare($result['api_version'], "1.0", ">")) {
if ($infInfo['name'] == $eth) { // error with KK9DS on $name (undefined index)
if (is_numeric($interface)) {
if ($infInfo['name'] == $eth) {
if (isset($infInfo['ip'])) {
if ($infInfo['ip'] == "none") {
if ($infInfo['ip'] == 'none') {
$lan_ip = "NotAvailable";
}else {
$lan_ip = $infInfo['ip']; //error with ke6upi here on $ip (undefinded index)
$lan_ip = $infInfo['ip'];
}
}elseif (!isset($infInfo['ip'])) {
}else {
$lan_ip = "NotAvailable";
}
}elseif ($infInfo['name'] == 'wlan0') {
$wlan_ip = $infInfo['ip'];
$wifi_mac_address = $infInfo['mac'];
}
if ($infInfo['name'] == "wlan0") {
}else {
if ($interface == $eth) {
$lan_ip = $infInfo['ip'];
}elseif ($interface == 'wlan0') {
$wlan_ip = $infInfo['ip'];
$wifi_mac_address = $infInfo['mac']; //added to fix MAC address issue, caught by Mark, N2MH 14 March 2017.
$wifi_mac_address = $infInfo['mac'];
}
}
}
......@@ -243,7 +250,7 @@ if($sysinfoJson === FALSE) {
//}else {
//
//}
echo "\n";
//echo "\n";
}
if ($do_sql) {
......@@ -392,6 +399,12 @@ if($sysinfoJson === FALSE) {
}
}
}
if ($testNodePolling) {
wxc_echoWithColor('****This nodes location has been "fixed" in the Database!****', 'alert');
echo "\n";
wxc_echoWithColor('****It will not update from polling if the location changes****', 'alert');
echo "\n";
}
}else {
//check if we have changed node name and have the same hardware.
//the database itself should handle if there is new hardware with the same node name.
......@@ -432,11 +445,11 @@ if($sysinfoJson === FALSE) {
$loadavg = NULL;
$services = NULL;
$sysinfoJson = NULL;
//$olsrdInfo = NULL;
}
//$sql_connection = wxc_connectToMySql();
//if ($sql_connection) {
//}
//update the database with the time, so we know when the last update is
if($do_sql) {
wxc_scriptUpdateDateTime("NODEINFO", "node_info");
wxc_putMySql("UPDATE map_info SET currently_running = '0' WHERE id = 'NODEINFO'");
}
?>
......@@ -107,22 +107,22 @@ inetTileServer['Terrain-Default'] = "//stamen-tiles-{s}.a.ssl.fastly.net/terrain
;;The Title of the web page, web page logo and the text above the map.
;--------------------------------------------------------------
pageTitle = "Mesh Map"
pageLogo = "images/MESHMAP_LOGO.svg"
logoHeaderText = "Mesh Map"
;pageLogo = "images/MESHMAP_LOGO.svg"
;logoHeaderText = "Mesh Map"
;;Welcome to the Mesh Map Message
;uncomment and edit the "otherTopOfMapMsg" below if you want to add other text above the map
;--------------------------------------------------------------
welcomeMessage = "Welcome to the Mesh Map"
;welcomeMessage = "Welcome to the Mesh Map"
;otherTopOfMapMsg = ""
;;Custom message if you are on the Mesh Server
;--------------------------------------------------------------
meshServerText = "You are connected to the Mesh Network and running on device: %s"
;meshServerText = "You are connected to the Mesh Network and running on device: %s"
;;Custom Message if you are on the Internet Server
;--------------------------------------------------------------
inetServerText = "Your are connected to the internet and are running on device: %s"
;inetServerText = "Your are connected to the internet and are running on device: %s"
;;Custom Mesh Warning message
;uncomment and edit to enable
......
......@@ -330,13 +330,6 @@ function wxc_checkErrorMessage ($error, $nodeName) {
}
if ($GLOBALS['do_sql']) {
wxc_putMySQL("INSERT INTO hosts_ignore SET ip = '$ip', name = '$nodeName', reason = 'no_route', timestamp = NOW() ON DUPLICATE KEY UPDATE ip = '$ip', name = '$nodeName', reason = 'refused', timestamp = NOW()");
/*
if (!wxc_getMySql("SELECT node FROM node_info WHERE wlan_ip = '$ip'")) {
wxc_putMySql("INSERT INTO node_info SET node = '$nodeName', wlan_ip = '$ip' ON DUPLICATE KEY UPDATE wlan_ip = '$ip'");
}
*/
}
if ($GLOBALS['testNodePolling'] && $nodeName) {
echo "\033[31mError while getting sysinfo.json\033[0m from \033[35m" . $nodeName . "\033[0m: no route to host!\n\n";
......@@ -376,7 +369,7 @@ function wxc_checkErrorMessage ($error, $nodeName) {
}
if (strpos($error['message'], 'Connection refused') !== false) {
//if we get a "connection refused" it's pretty safe to say we're not dealing with a node device
//or the sucker has really, really old firmware (3.15.*).
//or the sucker has really, really old firmware (< 3.15.*).
//but then I've actually seen "connection refused" from live nodes that I know are ok.
//I think it can also happen when OLSRd restarts or is rehashing it's files or something.
//these hosts get ignored for a while, but not too long.
......@@ -397,20 +390,13 @@ function wxc_checkErrorMessage ($error, $nodeName) {
}
if ($GLOBALS['do_sql']) {
wxc_putMySQL("INSERT INTO hosts_ignore SET ip = '$ip', name = '$nodeName', reason = 'refused', timestamp = NOW() ON DUPLICATE KEY UPDATE ip = '$ip', name = '$nodeName', reason = 'refused', timestamp = NOW()");
/*
if (!wxc_getMySql("SELECT node FROM node_info WHERE wlan_ip = '$ip'")) {
wxc_putMySql("INSERT INTO node_info SET node = '$nodeName', wlan_ip = '$ip' ON DUPLICATE KEY UPDATE wlan_ip = '$ip'");
}
*/
}
if ($GLOBALS['testNodePolling'] && $nodeName) {
echo "\033[31mError while getting sysinfo.json\033[0m from \033[35m" . $nodeName . "\033[0m: Connection Refused!\n\n";
}
}
if (strpos($error['message'], '404') !== false) {
//404 errors are probably nodes at firmware 3.15 or less or something else entirely
//404 errors are probably nodes at firmware < 3.15, or something else entirely
//these are only going to be checked once a day.
//if they *are* nodes hopefully someone can convince the owner to upgrade. :)
......@@ -461,9 +447,11 @@ function wxc_resolveIP ($ipAddr) {
//ask localnode directly to resolve this IP for us
$hostName = preg_replace("/.local.mesh/", "", gethostbyaddr_timeout("$hostName", $GLOBALS['USER_SETTINGS']['localnode'], 1));
}
if (filter_var($hostName, FILTER_VALIDATE_IP) != false) { //check again
echo "Unable to resolve: ". $ipAddr . "\n"; //give up and echo error msg and return the IP
}
//if (filter_var($hostName, FILTER_VALIDATE_IP) != false) { //check again
// if ($GLOBALS['testNodePolling']) {
// echo "Unable to resolve: ". $ipAddr . "\n"; //give up and echo error msg and return the IP
// }
//}
}
return $hostName;
}
......@@ -553,6 +541,16 @@ function wxc_putMySql ($query) {
}
}
function wxc_getMysqlFetchAll ($query) {
$results = array();
if (empty($query)) {
return 0;
}else {
//$theQuery = mysqli_query($GLOBALS['sql_connection'], $query) or die ("Could not fetch from SQL server. " . mysqli_error($GLOBALS['sql_connection']));
//foreach $item in $query as $whatever
return 1;
}
}
/**
* checkBand
*
......@@ -622,16 +620,6 @@ function wxc_checkBand ($channel, $board_id = null) {
}
//this is a pipe dream, but I could use it myself if I wanted to
//lets see if AREDN does something special just for me (I doubt it)
function wxc_hostFileHTTP ($isItAvailable) {
if ($testHostInfo = file_get_contents("http://localnode.local.mesh:8080/known_hosts.txt")) {
return $testHostInfo;
}else {
return 0;
}
}
//something I was playing with
function wxc_echoWithColor ($text, $color) {
if ($color == "red") {
......@@ -646,6 +634,12 @@ function wxc_echoWithColor ($text, $color) {
if ($color == "green") {
echo "\033[32m" . $text . "\033[0m";
}
if ($color == 'redBold') {
echo "\033[1m\33[31m" . $text . "\033[0m";
}
if ($color == 'alert') {
echo "\033[41m\033[30m\033[1m" . $text . "\033[0m";
}
}