Newb with While loop question

My first post here....
I have a few years exp with linux distros and some very basic Python..Ive been intent on learning shell scripting the last few weeks. Please excuse my crude efforts.

I am running a program that takes network data containing US city names in plain text. I am TRYING to write a shell scripts that will filter at the nic for specific cities (using tcpdump) and alert both on the monitor and with audio ( and eventually a text message)

Tcpdump and the filters work well however I cant figure out how to accurately display on the monitor and play the wav when a select city is found. (My audio script works well on its own).

This works for me so far...

tcpdump -s 700 -t -n -N -X src 67.1.1.1 | grep -E "Miami|Austin|Chicago|Reno"'

But when I try to add an audio alert with a loop...

#! /bin/bash/

func1='tcpdump -s 700 -t -n -N -X src 67.11.11.11 | grep -E "Miami|Austin|Chicago|Reno"'

while true; do
        [ "$func1" ]
        if [ "$func1"!="" ]
       then
            echo " found at " $(date)
            play sound.wav
       else
            continue
       fi
done

The above script comes back comes back positive with every pass of the loop and just prints "found at"

Can anyone give me some direction?
Thanks
Dave (hmm my indents didnt take here. I believe that all my indents are correct. Its the script that is incorrect)

        if [ "$func1" != "" ]

The indenting doesn't matter (just for readibility).
No need of func, no need of continue statement, it will continue anyway.

#! /bin/bash
while true
do
    if tcpdump -s 700 -t -n -N -X src 67.11.11.11 | grep -E "Miami|Austin|Chicago|Reno"
    then
        echo " found at " $(date)
        play sound.wav
    fi
done

Frans

I see your point. I figured that I was probably over complicating things.

Tried your suggestion exactly and the filter works well printing the city names however the "'found at' $date" does not display nor does the sound play. (Sound works fine when run independently). For whatever reason, that "then" statement does not complete??
Thanks
Dave

what gives this :

tcpdump -s 700 -t -n -N -X src 67.11.11.11 | grep -E "Miami|Austin|Chicago|Reno"
echo "Return code : $?"

I ran the code that you supplied and received this. Google search suggests that I likely got that error code from terminating the script (Ctrl+C)

^C1091 packets captured
1091 packets received by filter
0 packets dropped by kernel
Return code : 130

When I run it this way I get a 0 error code (although Im still killing it with Ctrl+c)

#! /bin/bash
while true
do
    if tcpdump -s 700 -t -n -N -X src 67.11.11.11 | grep -E "Miami|Austin|Chicago|Reno"
    then
        echo " found at " $(date)
        play sound.mp3
    fi
echo "Return code : $?"
done

1774 packets received by filter
0 packets dropped by kernel
Return code : 0

The returned code is the one of the last command. Maybe here it's of the 'true' at the beginning of the while loop.
Not sure that you can just grep the output of tcpdump to capture the city names.
I'm not familiar with tcpdump, but i think you should look at its manual to find another way.

Ive been through all the man pages. Cant seem to find a solution. Im taking a look at ngrep now to see what is available. Ill post the solution if I find it.
Thanks for your efforts!