#!/bin/sh
# Пассивный режим rc-shell (D28): демон слушает 127.0.0.1:<port>, mavp2p шлёт туда поток.
# Старые конфиги (режим клиента) указывали mavlink_host на IP роутера/192.168.10.1 — переводим.
h=$(uci -q get rc-shell.main.mavlink_host)
case "$h" in ""|127.0.0.1|0.0.0.0) ;; *) uci set rc-shell.main.mavlink_host=127.0.0.1 ;; esac
uci -q get rc-shell.main.dry_run >/dev/null || uci set rc-shell.main.dry_run=0
uci -q get rc-shell.main.statustext >/dev/null || uci set rc-shell.main.statustext=1
uci commit rc-shell
exit 0
