diff --git a/bash/portal/graphs.sh b/bash/portal/graphs.sh index ea01edf..a91214d 100755 --- a/bash/portal/graphs.sh +++ b/bash/portal/graphs.sh @@ -58,7 +58,7 @@ if [[ -z "${DUMP1090_INSTALLED}" ]] || [[ -z "${DUMP1090_FORK}" ]] ; then DUMP1090_INSTALLED="true" fi fi -if [ -f /etc/init.d/rtlsdr-ogn ]; then +if [[ -f /etc/init.d/rtlsdr-ogn ]] ; then RTLSDROGN_INSTALLED="true" fi @@ -74,7 +74,7 @@ fi ## MODIFY THE DUMP1090-MUTABILITY INIT SCRIPT TO MEASURE AND RETAIN NOISE DATA -if [[ ${DUMP1090_INSTALLED} = "true" ]] && [[ ${DUMP1090_FORK} = "mutability" ]] ; then +if [[ "${DUMP1090_INSTALLED}" = "true" ]] && [[ "${DUMP1090_FORK}" = "mutability" ]] ; then echo -e "\e[94m Modifying the dump1090-mutability init script to add noise measurements...\e[97m" sudo sed -i 's/ARGS=""/ARGS="--measure-noise "/g' /etc/init.d/dump1090-mutability 2>&1 echo -e "\e[94m Reloading the systemd manager configuration...\e[97m" @@ -118,7 +118,7 @@ WriteThreads 1 EOF # Dump1090 specific values. -if [[ ${DUMP1090_INSTALLED} = "true" ]] ; then +if [[ "${DUMP1090_INSTALLED}" = "true" ]] ; then sudo tee -a ${COLLECTD_CONFIG} > /dev/null < /dev/null < @@ -212,7 +212,7 @@ if [[ ${HARDWARE} == "RPI" ]] ; then EOF # CHIP specific values. -elif [[ ${HARDWARE} == "CHIP" ]] ; then +elif [[ "${HARDWARE}" = "CHIP" ]] ; then sudo tee -a ${COLLECTD_CONFIG} > /dev/null <
@@ -235,7 +235,7 @@ EOF fi # Dump1090 specific values. -if [[ ${DUMP1090_INSTALLED} = "true" ]] ; then +if [[ "${DUMP1090_INSTALLED}" = "true" ]] ; then sudo tee -a ${COLLECTD_CONFIG} > /dev/null < /dev/null < EOF +fi # Remaining config for all installations. sudo tee -a ${COLLECTD_CONFIG} > /dev/null <&1 # The next block is temporary in order to insure this file is # deleted on older installation before the project renaming. -if [ -f /etc/cron.d/adsb-feeder-performance-graphs ]; then +if [[ -f /etc/cron.d/adsb-feeder-performance-graphs ]] ; then echo -e "\e[94m Removing outdated performance graphs cron file...\e[97m" sudo rm -f /etc/cron.d/adsb-feeder-performance-graphs 2>&1 fi -if [ -f ${COLLECTD_CRON_FILE} ]; then +if [[ -f ${COLLECTD_CRON_FILE} ]] ; then echo -e "\e[94m Removing previously installed performance graphs cron file...\e[97m" sudo rm -f ${COLLECTD_CRON_FILE} 2>&1 fi