View Single Post
Old 05-17-2019, 02:30 AM
Zander Zander is offline
Registered User
Join Date: Oct 2016
Posts: 11
Originally Posted by bgagnon View Post
Hi Zander,

I guess we need to refine our keywords then because I'm sure I've seen this many times in our forums.

Maybe not "ip route-static" being the trigger phrase, but definitely the process described is similar.

What will you do with the data you pull out? Are you going to write it to a file? Use it in some way within the script?

As a starting point I always like to give the link to the scripting manual. In Chapter 4: Reading Data from Remote Machines (Section 4.3 specifically) are examples of various methods for capturing the data, such as using Get(), Get2() and ReadString(). Then there's an entire section on VBS functions designed to extract the data, such as InStr(), Split(), etc.

Once I have a better understanding of the overall objective, I'll see if I can locate any other posts with relevant info.
Apologies bgagnon, poor wording on my part there - I'm not the most advanced when it comes to this sort of thing and I haven't been able to spot something that relates to me. However that may be because I've not fully understood what I was reading

I need to manipulate the output and then write it to a file. Basically I would like to pull out every instance in the configuration that contains "ip route-static", remove some parts of that line and then write that to file. I know how to write a string to a file and I'm able to utilise the functions used in this example script to pull out the first instance of "ip route-static" but obviously I'd like to pull out all instances. If it helps at all, the line itself would look like this
ip route-static vpn-instance [VPN] [IP Pool Network Address] [Subnet mask] [Interface] description [description]
(If there are multiple lines then they will look the same, just one after another). So what I'd like to be left with is just the IP Pool Network Address + Subnet mask to write to a file

Thanks for taking the time to help me out, it's greatly appreciated
Reply With Quote