Forum Discussion
Jeremy_Bridges_
Nimbostratus
Aug 21, 2009Custom TCP Monitor
I am looking to do some custom TCP monitoring with a custom application that we need to monitor with the F5. Essentially, the application's thread handling logic will hang unless a specific set of se...
Jeremy_Bridges_
Nimbostratus
Sep 02, 2009I am a bit of a newbie to BASH. So, I am running into trouble encoding the input properly into my script. Mind if you help me set it up correctly? Here is what I have so far:
!/bin/bash
ip=`echo ${1} | sed 's/::ffff://'`
port=${2}
input="FDCB^_^@^@^@Service=RC_SERVICE^^Command=Ping^@^@^@^@"
output=$(echo $input | nc $ip $port -w 5)
if [[ $output == *BusinessCode* ]]
then echo "UP"
fi
When executed, the script waits 1-2 seconds and then pushes nothing to output. After echoing back the input and output variables, it seems the input variable is not being encoded properly. How do I properly encode the extended ASCII chars into a BASH variable?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
