Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- topology.sh
- #!/bin/bash
- while [ $# -gt 0 ] ; do
- nodeArg=$1
- exec< /home/hduser/scripts/topology.data
- result=""
- while read line ; do
- ar=( $line )
- if [ "${ar[0]}" = "$nodeArg" ] ; then
- result="${ar[1]}"
- fi
- done
- shift
- if [ -z "$result" ] ; then
- echo -n "/default-rack "
- else
- echo -n "$result "
- fi
- done
- topology.data
- 10.0.1.97 /dc1/rack1
- 10.0.1.55 /dc1/rack2
Advertisement
Add Comment
Please, Sign In to add comment