bash script to list which virtual servers are using a specific pool.
Published May 05, 2015
Version 1.0Was this article helpful?
@Wallace, assuming your are iterating through a list of VS names and you want to check if they exist first, the following may work. It attempts to list the VS name passed in, if it exists do something, if the command errors ie. the VS doesn't exist do nothing.
tmsh_out=""
tmsh_out=$(tmsh -q list ltm virtual $vs 2>/dev/null)
[[ "$tmsh_out" ]] && echo 1