#!/bin/bash # Frequency map for Translator @ Montpellier Service Basin Highton: declare -A FREQ_MAP FREQ_MAP["Seven"]=655500000 FREQ_MAP["Nine"]=662500000 FREQ_MAP["Ten"]=669500000 FREQ_MAP["ABC"]=676500000 FREQ_MAP["SBS"]=683500000 analyze_frequency() { local channel="$1" local freq="${FREQ_MAP[$channel]}" echo "Starting analysis for $channel..." timeout 1200 tsp -I dvb -a 0 --bandwidth 7 -f "$freq" \ -P skip 5000 \ -P until -s 100 \ -P analyze --title "$channel (Frequency $freq)" -o "$channel.analysis" \ -P analyze --title "$channel (Frequency $freq)" -o "$channel.anl" --normalized \ -P psi -a -o "$channel.psi" \ -O drop if [ $? -eq 124 ]; then echo "Timeout reached for $channel. Consider increasing the timeout or checking the tsp command parameters." else echo "Completed analysis for $channel." fi } capture_frequency() { local channel="$1" local freq="${FREQ_MAP[$channel]}" echo "Starting capture for $channel..." timeout 1200 tsp -I dvb -a 0 --bandwidth 7 -f "$freq" \ -P skip 5000 \ -P until -s 60 \ -O file "$channel.ts" if [ $? -eq 124 ]; then echo "Timeout reached for $channel. Consider increasing the timeout or checking the tsp command parameters." else echo "Completed capture for $channel." fi } if [ "$1" = "capture" ]; then for channel in "${!FREQ_MAP[@]}"; do capture_frequency "$channel" done else for channel in "${!FREQ_MAP[@]}"; do analyze_frequency "$channel" done fi