#!/bin/bash let "BraceCount = 0" cat /config/bigip.conf | while read line do firstword=`echo -e $line | cut -f1 -d' '` lastword=`echo $line | awk '{print $NF}'` if [ "$firstword" = "virtual" ] && [ "`echo -e $line | cut -f2 -d' '`" != "address" ]; then VsName=`echo -e $line | cut -f2 -d' '` ASMProfile=NULL InsideVsTags=T let "BraceCount = 1" fi if [ "$InsideVsTags" = "T" ]; then if [ "$lastword" = "{" ]; then let "BraceCount += 1"; fi if [ "$lastword" = "}" ]; then let "BraceCount -= 1"; fi #echo $BraceCount if [ "$firstword" = "httpclass" ]; then ASMProfile=`echo -e $line | cut -f2 -d' '` if [ "$ASMProfile" = "{" ]; then ASMProfile="*Multiple*" fi fi if [ "`echo $line | cut -b1`" = "}" ] && [ $BraceCount -eq 1 ]; then InsideVsTags=0 echo -e "$VsName \t $ASMProfile" fi fi done