kopia lustrzana https://github.com/jprochazka/adsb-receiver
Fomatting update to rtlsdr-ogn.sh
rodzic
9953e8134f
commit
6c4c83d8a3
|
|
@ -76,7 +76,7 @@ fi
|
|||
|
||||
### CHECK FOR PREREQUISITE PACKAGES
|
||||
|
||||
echo -e "\e[95m Installing packages needed to build and fulfill dependencies for ${DECODER_NAME} ...\e[97m"
|
||||
echo -e "\e[95m Installing packages needed to build and fulfill dependencies for ${DECODER_NAME}...\e[97m"
|
||||
echo -e ""
|
||||
CheckPackage git
|
||||
CheckPackage rtl-sdr
|
||||
|
|
@ -185,32 +185,32 @@ if [[ ${TUNER_COUNT} -gt 1 ]] ; then
|
|||
if [[ -n ${OGN_DEVICE_SERIAL} ]] ; then
|
||||
if [[ `rtl_test 2>&1 | grep -c "SN: ${OGN_DEVICE_SERIAL}" ` -eq 1 ]] ; then
|
||||
OGN_DEVICE_ID=`rtl_test 2>&1 | grep "SN: ${OGN_DEVICE_SERIAL}" | awk -F ":" '{print $1}' | sed -e 's/\ //g' `
|
||||
echo -e "\e [94m RTL-SDR with Serial \"${OGN_DEVICE_SERIAL}\" found at device \"${OGN_DEVICE_ID}\" and will be assigned to ${DECODER_NAME} ...\e [97m"
|
||||
echo -e "\e [94m RTL-SDR with Serial \"${OGN_DEVICE_SERIAL}\" found at device \"${OGN_DEVICE_ID}\" and will be assigned to ${DECODER_NAME}...\e [97m"
|
||||
else
|
||||
echo -e "\e [94m RTL-SDR with Serial \"${OGN_DEVICE_SERIAL}\" not found, assigning device \"0\" to ${DECODER_NAME} ...\e [97m"
|
||||
echo -e "\e [94m RTL-SDR with Serial \"${OGN_DEVICE_SERIAL}\" not found, assigning device \"0\" to ${DECODER_NAME}...\e [97m"
|
||||
fi
|
||||
# Or if a device has been specified by device ID then confirm this is currently detected.
|
||||
elif [[ -n ${OGN_DEVICE_ID} ]] ; then
|
||||
if [[ `rtl_test 2>&1 | grep "SN: " | grep -c "^\ *${OGN_DEVICE_ID}:"` -eq 1 ]] ; then
|
||||
echo -e "\e [94m RTL-SDR device \"${OGN_DEVICE_ID}\" found and will be assigned to ${DECODER_NAME} ...\e [97m"
|
||||
echo -e "\e [94m RTL-SDR device \"${OGN_DEVICE_ID}\" found and will be assigned to ${DECODER_NAME}...\e [97m"
|
||||
else
|
||||
echo -e "\e [94m RTL-SDR device \"${OGN_DEVICE_ID}\" not found, assigning device \"0\" to ${DECODER_NAME} ...\e [97m"
|
||||
echo -e "\e [94m RTL-SDR device \"${OGN_DEVICE_ID}\" not found, assigning device \"0\" to ${DECODER_NAME}...\e [97m"
|
||||
fi
|
||||
# Failing that configure it with device ID 0.
|
||||
else
|
||||
if [[ -z ${OGN_DEVICE_ID} ]] ; then
|
||||
echo -e "\e [94m No RTL-SDR device specified, assigning device \"0\" to ${DECODER_NAME} ...\e [97m"
|
||||
echo -e "\e [94m No RTL-SDR device specified, assigning device \"0\" to ${DECODER_NAME}...\e [97m"
|
||||
OGN_DEVICE_ID="0"
|
||||
fi
|
||||
fi
|
||||
# Single tuner present so assign device 0 and stop any other running decoders, or at least dump1090-mutablity for a default install.
|
||||
elif [[ ${TUNER_COUNT} -eq 1 ]] ; then
|
||||
echo -e "\e [94m Single RTL-SDR device \"0\" detected and assigned to ${DECODER_NAME} ...\e [97m"
|
||||
echo -e "\e [94m Single RTL-SDR device \"0\" detected and assigned to ${DECODER_NAME}...\e [97m"
|
||||
OGN_DEVICE_ID="0"
|
||||
sudo /etc/init.d/dump1090-mutability stop
|
||||
# No tuners present so assign device 0 and stop any other running decoders, or at least dump1090-mutablity for a default install.
|
||||
elif [[ ${TUNER_COUNT} -lt 1 ]] ; then
|
||||
echo -e "\e [94m No RTL-SDR device detected so ${DECODER_NAME} will be assigned device \"0\" ...\e [97m"
|
||||
echo -e "\e [94m No RTL-SDR device detected so ${DECODER_NAME} will be assigned device \"0\"...\e [97m"
|
||||
OGN_DEVICE_ID="0"
|
||||
sudo /etc/init.d/dump1090-mutability stop 2>/dev/null
|
||||
fi
|
||||
|
|
@ -273,6 +273,7 @@ fi
|
|||
if [[ -s $BUILDDIRECTORY_RTLSDROGN/rtlsdr-ogn/${OGN_CALLSIGN}.conf ]] ; then
|
||||
echo -e "\e [94m Existing ${DECODER_NAME} config file \"${OGN_CALLSIGN}.conf\" found...\e [97m"
|
||||
else
|
||||
echo -e "\e [94m Generating new ${DECODER_NAME} config file as \"${OGN_CALLSIGN}.conf\"...\e [97m"
|
||||
sudo tee $BUILDDIRECTORY_RTLSDROGN/rtlsdr-ogn/${OGN_CALLSIGN}.conf > /dev/null <<EOF
|
||||
###########################################################################################
|
||||
# #
|
||||
|
|
@ -323,7 +324,7 @@ echo -e "\033[37m"
|
|||
sudo wget http://download.glidernet.org/common/service/rtlsdr-ogn -O ${DECODER_SERVICE_SCRIPT}
|
||||
sudo chmod +x ${DECODER_SERVICE_SCRIPT}
|
||||
|
||||
echo -e "\033[33m Creating file ${DECODER_SERVICE_CONFIG} ..."
|
||||
echo -e "\033[33m Creating service config file \"${DECODER_SERVICE_CONFIG}\"..."
|
||||
echo -e "\033[37m"
|
||||
sudo tee ${DECODER_SERVICE_CONFIG} > /dev/null <<EOF
|
||||
#shellbox configuration file
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue