Forum Discussion
Input File Containing VIPs for Deletion int TCL Script
I have a long list of VIPs to delete and looking at the sample scripts on Dev Central I only see that the scripts pull the whole list of VIPs and then the operations are done on them. Preferably, I would like to do something like below where each VIP name is read from a file and deleted, unless someone thinks otherwise of a better way. If I go the file route, do I need to refer to the file with $tmsh::argv, or that's not needed?
Read file to take VIP names
set infile [open "viplist.txt" r]
while { [gets $infile line] >= 0 } {
as long as I'm not at the end of my file, take the value of VIP name and delete it as below
tmsh::delete /ltm virtual $line
}
close $infile
I think that a basic bash script that invokes tmsh commands would be better for your task
For a preparation, format your file as follows with a list of valid tmsh commands (vi search & replace can help with preparation):
tmsh delete ltm virtual vsname1 tmsh delete ltm virtual vsname2 tmsh delete ltm virtual vsname3 tmsh delete ltm virtual vsnameX
Save it as 'deletevs.sh' file
- Execute the file as bash script
, and wait until the labour is donebash deletevs.sh -x
- Execute the file as bash script
- Hannes_RappNimbostratus
I think that a basic bash script that invokes tmsh commands would be better for your task
For a preparation, format your file as follows with a list of valid tmsh commands (vi search & replace can help with preparation):
tmsh delete ltm virtual vsname1 tmsh delete ltm virtual vsname2 tmsh delete ltm virtual vsname3 tmsh delete ltm virtual vsnameX
Save it as 'deletevs.sh' file
- Execute the file as bash script
, and wait until the labour is donebash deletevs.sh -x
- raytapay_75679NimbostratusThanks for the response. Actually, I went with Excel as my VI skills are not superb but I see your point.
- Execute the file as bash script
- Hannes_Rapp_162Nacreous
I think that a basic bash script that invokes tmsh commands would be better for your task
For a preparation, format your file as follows with a list of valid tmsh commands (vi search & replace can help with preparation):
tmsh delete ltm virtual vsname1 tmsh delete ltm virtual vsname2 tmsh delete ltm virtual vsname3 tmsh delete ltm virtual vsnameX
Save it as 'deletevs.sh' file
- Execute the file as bash script
, and wait until the labour is donebash deletevs.sh -x
- raytapay_75679NimbostratusThanks for the response. Actually, I went with Excel as my VI skills are not superb but I see your point.
- Execute the file as bash script
Recent Discussions
Related Content
* 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