aboutsummaryrefslogtreecommitdiff
path: root/utils/dump1090/files
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2014-10-25 16:14:08 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2014-10-25 16:14:08 +0200
commitc778155ffffbaeb7c5e72ed765e95e1472d01153 (patch)
treeead3e7a2f2ce0c8b74398a2c2d90505c5b8d901a /utils/dump1090/files
parent5a744f9ec7fe2b38bb9ad1fc497a3d3e6a42df82 (diff)
dump1090: update to latest version, add init script and config.
Signed-off-by: Roger D <rogerdammit@gmail.com> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'utils/dump1090/files')
-rw-r--r--utils/dump1090/files/dump1090.config42
-rw-r--r--utils/dump1090/files/dump1090.init91
2 files changed, 133 insertions, 0 deletions
diff --git a/utils/dump1090/files/dump1090.config b/utils/dump1090/files/dump1090.config
new file mode 100644
index 000000000..2fa76836d
--- /dev/null
+++ b/utils/dump1090/files/dump1090.config
@@ -0,0 +1,42 @@
+config dump1090 main
+ option disabled '1'
+ option device_index ''
+ option gain ''
+ option enable_agc '0'
+ option freq ''
+ option ifile ''
+ option interactive '0'
+ option interactive_rows ''
+ option interactive_ttl ''
+ option interactive_rtl1090 '0'
+ option raw '0'
+ option net '1'
+ option modeac '0'
+ option net_beast '0'
+ option net_only '0'
+ option net_http_port '8080'
+ option net_ri_port ''
+ option net_ro_port ''
+ option net_sbs_port ''
+ option net_bi_port ''
+ option net_bo_port ''
+ option net_ro_size ''
+ option net_ro_rate ''
+ option net_heartbeat ''
+ option net_buffer ''
+ option lat ''
+ option lon ''
+ option fix '0'
+ option no_fix '0'
+ option no_crc_check '0'
+ option phase_enhance '0'
+ option agressive '0'
+ option mlat '0'
+ option stats '0'
+ option stats_every ''
+ option onlyaddr '0'
+ option metric '0'
+ option snip ''
+ option debug ''
+ option quiet '1'
+ option ppm ''
diff --git a/utils/dump1090/files/dump1090.init b/utils/dump1090/files/dump1090.init
new file mode 100644
index 000000000..816887a1f
--- /dev/null
+++ b/utils/dump1090/files/dump1090.init
@@ -0,0 +1,91 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+START=90
+STOP=10
+USE_PROCD=1
+
+append_arg() {
+ local cfg="$1"
+ local var="$2"
+ local opt="$3"
+ local def="$4"
+ local val
+
+ config_get val "$cfg" "$var"
+ [ -n "$val" -o -n "$def" ] && procd_append_param command $opt "${val:-$def}"
+}
+
+append_bool() {
+ local cfg="$1"
+ local var="$2"
+ local opt="$3"
+ local def="$4"
+ local val
+
+ config_get_bool val "$cfg" "$var" "$def"
+ [ "$val" = 1 ] && procd_append_param command "$opt"
+}
+
+start_instance() {
+ local cfg="$1"
+
+ config_get_bool disabled "$cfg" 'disabled' '0'
+ [ "$disabled" = 1 ] && return 1
+
+ procd_open_instance
+
+ procd_set_param command /usr/bin/dump1090
+
+ append_arg "$cfg" device_index "--device-index"
+ append_arg "$cfg" gain "--gain"
+ append_bool "$cfg" enable_agc "--enable-agc"
+ append_arg "$cfg" freq "--freq"
+ append_arg "$cfg" ifile "--ifile"
+ append_bool "$cfg" interactive "--interactive"
+ append_arg "$cfg" interactive_rows "--interactive-rows"
+ append_arg "$cfg" interactive_ttl "--interactive-ttl"
+ append_bool "$cfg" interactive_rtl1090 "--interactive-rtl1090"
+ append_bool "$cfg" raw "--raw"
+ append_bool "$cfg" net "--net"
+ append_bool "$cfg" modeac "--modeac"
+ append_bool "$cfg" net_beast "--net-beast"
+ append_bool "$cfg" net_only "--net-only"
+ append_arg "$cfg" net_http_port "--net-http-port"
+ append_arg "$cfg" net_ri_port "--net-ri-port"
+ append_arg "$cfg" net_ro_port "--net-ro-port"
+ append_arg "$cfg" net_sbs_port "--net-sbs-port"
+ append_arg "$cfg" net_bi_port "--net-bi-port"
+ append_arg "$cfg" net_bo_port "--net-bo-port"
+ append_arg "$cfg" net_ro_size "--net-ro-size"
+ append_arg "$cfg" net_ro_rate "--net-ro-rate"
+ append_arg "$cfg" net_heartbeat "--net-heartbeat"
+ append_arg "$cfg" net_buffer "--net-buffer"
+ append_arg "$cfg" lat "--lat"
+ append_arg "$cfg" lon "--lon"
+ append_bool "$cfg" fix "--fix"
+ append_bool "$cfg" no_fix "--no-fix"
+ append_bool "$cfg" no_crc_check "--no-crc-check"
+ append_bool "$cfg" phase_enhance "--phase-enhance"
+ append_bool "$cfg" agressive "--agressive"
+ append_bool "$cfg" mlat "--mlat"
+ append_bool "$cfg" stats "--stats"
+ append_arg "$cfg" stats_every "--stats-every"
+ append_bool "$cfg" onlyaddr "--onlyaddr"
+ append_bool "$cfg" metric "--metric"
+ append_arg "$cfg" snip "--snip"
+ append_arg "$cfg" debug "--debug"
+ append_bool "$cfg" quiet "--quiet"
+ append_arg "$cfg" ppm "--ppm"
+
+ procd_close_instance
+}
+
+service_triggers() {
+ procd_add_reload_trigger "dump1090"
+}
+
+start_service() {
+ config_load dump1090
+ config_foreach start_instance dump1090
+}