Merge pull request #7 from dschaper/dschaper-regex-patch

Was looking at those lines earlier...
So simple take what's between the {}.
thanks for the improvement.
This commit is contained in:
Joe Prochazka 2015-11-05 21:48:28 -05:00
commit 3abe17d674

View file

@ -32,10 +32,8 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo -e "\033[33m"
echo "Adding the ADS-B Exchange feed to PiAware's configuration..."
echo -e "\033[37m"
MLATRESULTFORMAT=`sudo piaware-config -show | grep mlatResultsFormat`
ORIGINALFORMAT=`sed 's/mlatResultsFormat //g' <<< $MLATRESULTFORMAT`
ORIGINALFORMAT=`sudo piaware-config -show | sed -n 's/.*{\(.*\)}.*/\1/p'`
CLEANFORMAT=`sed 's/ beast,connect,feed.adsbexchange.com:30005//g' <<< $ORIGINALFORMAT`
CLEANFORMAT=`sed 's/[{}]//g' <<< $CLEANFORMAT`
COMMAND=`sudo piaware-config -mlatResultsFormat "${CLEANFORMAT} beast,connect,feed.adsbexchange.com:30005"`
$COMMAND
sudo piaware-config -restart