kopia lustrzana https://github.com/jprochazka/adsb-receiver
				
				
				
			Beast Splitter and Duck DNS - Harmonized tests to use double square brackets
							rodzic
							
								
									f36b96829d
								
							
						
					
					
						commit
						f43bdb06c1
					
				| 
						 | 
				
			
			@ -36,13 +36,13 @@
 | 
			
		|||
source $RECEIVER_BASH_DIRECTORY/variables.sh
 | 
			
		||||
source $RECEIVER_BASH_DIRECTORY/functions.sh
 | 
			
		||||
 | 
			
		||||
if [ "$RECEIVER_AUTOMATED_INSTALL" = "true" ]; then
 | 
			
		||||
if [[ "$RECEIVER_AUTOMATED_INSTALL" = "true" ]] ; then
 | 
			
		||||
    source $RECEIVER_CONFIGURATION_FILE
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
### BEGIN SETUP
 | 
			
		||||
 | 
			
		||||
if [ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]; then
 | 
			
		||||
if [[ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]] ; then
 | 
			
		||||
    clear
 | 
			
		||||
    echo -e "\n\e[91m   $RECEIVER_PROJECT_TITLE"
 | 
			
		||||
fi
 | 
			
		||||
| 
						 | 
				
			
			@ -50,9 +50,9 @@ echo ""
 | 
			
		|||
echo -e "\e[92m  Setting up beast-splitter..."
 | 
			
		||||
echo -e "\e[93m----------------------------------------------------------------------------------------------------\e[96m"
 | 
			
		||||
echo ""
 | 
			
		||||
if [ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]; then
 | 
			
		||||
if [[ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]] ; then
 | 
			
		||||
    whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "Beast-Splitter Setup" --yesno "This is a helper utility for the Mode-S Beast.\n\nThe Beast provides a single data stream over a (USB) serial port. If you have more than one thing that wants to read that data stream, you need something to redistribute the data. This is what beast-splitter does.\n\n  https://github.com/flightaware/beast-splitter\n\nContinue beast-splitter setup?" 15 78
 | 
			
		||||
    if [ $? -eq 1 ]; then
 | 
			
		||||
    if [[ $? -eq 1 ]] ; then
 | 
			
		||||
        # Setup has been halted by the user.
 | 
			
		||||
        echo -e "\e[91m  \e[5mINSTALLATION HALTED!\e[25m"
 | 
			
		||||
        echo -e "  Setup has been halted at the request of the user."
 | 
			
		||||
| 
						 | 
				
			
			@ -83,9 +83,9 @@ CheckPackage dh-systemd
 | 
			
		|||
### CONFIRM SETTINGS
 | 
			
		||||
 | 
			
		||||
# Confirm settings with user.
 | 
			
		||||
if [ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]; then
 | 
			
		||||
if [[ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]] ; then
 | 
			
		||||
    # Ask the beast-splitter listen port.
 | 
			
		||||
    if [ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]; then
 | 
			
		||||
    if [[ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]] ; then
 | 
			
		||||
        BEASTSPLITTER_LISTEN_PORT_TITLE="Listen Port"
 | 
			
		||||
        while [[ -z $BEASTSPLITTER_LISTEN_PORT ]]; do
 | 
			
		||||
            BEASTSPLITTER_LISTEN_PORT=$(whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "$BEASTSPLITTER_LISTEN_PORT_TITLE" --nocancel --inputbox "\nPlease enter the port beast-splitter will listen on.\nThis must be a port which is currently not in use." 10 78 "30005" 3>&1 1>&2 2>&3)
 | 
			
		||||
| 
						 | 
				
			
			@ -94,7 +94,7 @@ if [ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]; then
 | 
			
		|||
    fi
 | 
			
		||||
 | 
			
		||||
    # Ask the beast-splitter connect port.
 | 
			
		||||
    if [ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]; then
 | 
			
		||||
    if [[ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]] ; then
 | 
			
		||||
        BEASTSPLITTER_CONNECT_PORT_TITLE="Connect Port"
 | 
			
		||||
        while [[ -z $BEASTSPLITTER_CONNECT_PORT ]]; do
 | 
			
		||||
            BEASTSPLITTER_CONNECT_PORT=$(whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "$BEASTSPLITTER_CONNECT_PORT_TITLE" --nocancel --inputbox "\nPlease enter the port beast-splitter will connect to.\nThis is generally port 30104 on dump1090." 10 78 "30104" 3>&1 1>&2 2>&3)
 | 
			
		||||
| 
						 | 
				
			
			@ -108,7 +108,7 @@ fi
 | 
			
		|||
echo ""
 | 
			
		||||
echo -e "\e[95m  Preparing the beast-splitter Git repository...\e[97m"
 | 
			
		||||
echo ""
 | 
			
		||||
if [ -d $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter ] && [ -d $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter/.git ]; then
 | 
			
		||||
if [[ -d $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter ]] && [[ -d $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter/.git ]] ; then
 | 
			
		||||
    # A directory with a git repository containing the source code already exists.
 | 
			
		||||
    echo -e "\e[94m  Entering the beast-splitter git repository directory...\e[97m"
 | 
			
		||||
    cd $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter
 | 
			
		||||
| 
						 | 
				
			
			@ -129,7 +129,7 @@ fi
 | 
			
		|||
echo ""
 | 
			
		||||
echo -e "\e[95m  Building and installing the beast-splitter package...\e[97m"
 | 
			
		||||
echo ""
 | 
			
		||||
if [ ! "$PWD" = $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter ]; then
 | 
			
		||||
if [[ ! "$PWD" = $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter ]] ; then
 | 
			
		||||
    echo -e "\e[94m  Entering the piaware_builder git repository directory...\e[97m"
 | 
			
		||||
    cd $RECEIVER_BUILD_DIRECTORY/beast-splitter/beast-splitter
 | 
			
		||||
fi
 | 
			
		||||
| 
						 | 
				
			
			@ -173,7 +173,7 @@ echo ""
 | 
			
		|||
# Kill any currently running instances of the beast-splitter_maint.sh script.
 | 
			
		||||
echo -e "\e[94m  Checking for any running beast-splitter_maint.sh processes...\e[97m"
 | 
			
		||||
PIDS=`ps -efww | grep -w "beast-splitter_maint.sh" | awk -vpid=$$ '$2 != pid { print $2 }'`
 | 
			
		||||
if [ ! -z "$PIDS" ]; then
 | 
			
		||||
if [[ ! -z "$PIDS" ]] ; then
 | 
			
		||||
    echo -e "\e[94m  Killing any running beast-splitter_maint.sh processes...\e[97m"
 | 
			
		||||
    sudo kill $PIDS
 | 
			
		||||
    sudo kill -9 $PIDS
 | 
			
		||||
| 
						 | 
				
			
			@ -181,7 +181,7 @@ fi
 | 
			
		|||
# Kill any currently running instances beast-splitter.
 | 
			
		||||
echo -e "\e[94m  Checking for any running beast-splitter processes...\e[97m"
 | 
			
		||||
PIDS=`ps -efww | grep -w "beast-splitter" | awk -vpid=$$ '$2 != pid { print $2 }'`
 | 
			
		||||
if [ ! -z "$PIDS" ]; then
 | 
			
		||||
if [[ ! -z "$PIDS" ]] ; then
 | 
			
		||||
    echo -e "\e[94m  Killing any running beast-splitter processes...\e[97m"
 | 
			
		||||
    sudo kill $PIDS
 | 
			
		||||
    sudo kill -9 $PIDS
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,13 +36,13 @@
 | 
			
		|||
source $RECEIVER_BASH_DIRECTORY/variables.sh
 | 
			
		||||
source $RECEIVER_BASH_DIRECTORY/functions.sh
 | 
			
		||||
 | 
			
		||||
if [ "$RECEIVER_AUTOMATED_INSTALL" = "true" ]; then
 | 
			
		||||
if [[ "$RECEIVER_AUTOMATED_INSTALL" = "true" ]] ; then
 | 
			
		||||
    source $RECEIVER_CONFIGURATION_FILE
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
### BEGIN SETUP
 | 
			
		||||
 | 
			
		||||
if [ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]; then
 | 
			
		||||
if [[ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]] ; then
 | 
			
		||||
    clear
 | 
			
		||||
    echo -e "\n\e[91m   $RECEIVER_PROJECT_TITLE"
 | 
			
		||||
fi
 | 
			
		||||
| 
						 | 
				
			
			@ -50,9 +50,9 @@ echo ""
 | 
			
		|||
echo -e "\e[92m  Setting up the Duck DNS dynamic DNS update script..."
 | 
			
		||||
echo -e "\e[93m----------------------------------------------------------------------------------------------------\e[96m"
 | 
			
		||||
echo ""
 | 
			
		||||
if [ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]; then
 | 
			
		||||
if [[ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]] ; then
 | 
			
		||||
    whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "Duck DNS Dynamic DNS" --yesno "Duck DNS is a free dynamic DNS service hosted on Amazon VPC.\n\nPLEASE NOTE:\n\nBefore continuing this setup it is recommended that you visit the Duck DNS website and signup for then setup a sub domain which will be used by this device. You will need both the domain and token supplied to you after setting up your account.\n\nhttp://www.duckdns.org\n\nContinue with Duck DNS update script setup?" 18 78
 | 
			
		||||
    if [ $? -eq 1 ]; then
 | 
			
		||||
    if [[ $? -eq 1 ]] ; then
 | 
			
		||||
        # Setup has been halted by the user.
 | 
			
		||||
        echo -e "\e[91m  \e[5mINSTALLATION HALTED!\e[25m"
 | 
			
		||||
        echo -e "  Setup has been halted at the request of the user."
 | 
			
		||||
| 
						 | 
				
			
			@ -79,7 +79,7 @@ CheckPackage curl
 | 
			
		|||
### CONFIRM SETTINGS
 | 
			
		||||
 | 
			
		||||
# Confirm settings with user.
 | 
			
		||||
if [ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]; then
 | 
			
		||||
if [[ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]] ; then
 | 
			
		||||
    # Ask for the user sub domain to be assigned to this device.
 | 
			
		||||
    DUCKDNS_DOMAIN_TITLE="Duck DNS Sub Domain"
 | 
			
		||||
    while [[ -z $DOMAIN ]]; do
 | 
			
		||||
| 
						 | 
				
			
			@ -95,7 +95,7 @@ if [ "$RECEIVER_AUTOMATED_INSTALL" = "false" ]; then
 | 
			
		|||
fi
 | 
			
		||||
 | 
			
		||||
# Create a duckdns directory within the build directory if it does not already exist.
 | 
			
		||||
if [ ! -d $RECEIVER_BUILD_DIRECTORY/duckdns ]; then
 | 
			
		||||
if [[ ! -d $RECEIVER_BUILD_DIRECTORY/duckdns ]] ; then
 | 
			
		||||
    echo -e "\e[94m  Creating the directory $RECEIVER_BUILD_DIRECTORY/duckdns...\e[97m"
 | 
			
		||||
    mkdir $RECEIVER_BUILD_DIRECTORY/duckdns
 | 
			
		||||
fi
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue