Fix setup.sh hanging on rtlamr prompt by using ask_yes_no helper

Replace raw read commands with ask_yes_no function for rtlamr
installation prompts on both macOS and Debian. The helper properly
handles non-interactive mode and missing TTY scenarios.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-20 18:16:05 +00:00
parent 90d2d42478
commit ed58681800

View File

@@ -443,8 +443,7 @@ install_macos_packages() {
if ! cmd_exists rtlamr; then
echo
info "rtlamr is used for utility meter monitoring (electric/gas/water meters)."
read -r -p "Do you want to install rtlamr? [y/N] " install_rtlamr
if [[ "$install_rtlamr" =~ ^[Yy]$ ]]; then
if ask_yes_no "Do you want to install rtlamr?"; then
install_rtlamr_from_source
else
warn "Skipping rtlamr installation. You can install it later if needed."
@@ -762,8 +761,7 @@ install_debian_packages() {
if ! cmd_exists rtlamr; then
echo
info "rtlamr is used for utility meter monitoring (electric/gas/water meters)."
read -r -p "Do you want to install rtlamr? [y/N] " install_rtlamr
if [[ "$install_rtlamr" =~ ^[Yy]$ ]]; then
if ask_yes_no "Do you want to install rtlamr?"; then
install_rtlamr_from_source
else
warn "Skipping rtlamr installation. You can install it later if needed."