From a620634f546fb37b635a0355142ff1077a6c5e75 Mon Sep 17 00:00:00 2001 From: Mike Nye Date: Mon, 22 Mar 2021 23:22:28 +0800 Subject: [PATCH] add config variable "override-site-info-host" --- package/fa_piaware_config.tcl | 2 ++ programs/piaware/health.tcl | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/package/fa_piaware_config.tcl b/package/fa_piaware_config.tcl index 03994711..077b3052 100644 --- a/package/fa_piaware_config.tcl +++ b/package/fa_piaware_config.tcl @@ -1063,6 +1063,8 @@ namespace eval ::fa_piaware_config { {"uat-sdr-device" -default "driver=rtlsdr" -sdonly 1} {"use-gpsd" -type boolean -default yes} + + {"override-site-info-host"} } return [uplevel 1 ::fa_piaware_config::new ::fa_piaware_config::ConfigMetadata [list $name] [list $settings]] diff --git a/programs/piaware/health.tcl b/programs/piaware/health.tcl index 417355f4..098c2ddf 100644 --- a/programs/piaware/health.tcl +++ b/programs/piaware/health.tcl @@ -25,8 +25,23 @@ proc construct_health_array {_row} { catch { if {[::fa_sysinfo::route_to_flightaware gateway iface ip]} { - set row(local_ip) $ip - set row(local_iface) $iface + + # get override-site-info-host + set osih [piawareConfig get override-site-info-host] + + # if override-site-info-host is not set, then send the ip as-per fa_sysinfo + if {$osih eq ""} { + + set row(local_ip) $ip + set row(local_iface) $iface + + # if override-site-info-host is set, then send the contents of override-site-info-host + } else { + + set row(local_ip) $osih + set row(local_iface) $iface + + } } }