Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Thread Tools Rate Thread Display Modes
Old 09-03-2016, 05:06 AM
noelvd's Avatar
noelvd noelvd is offline
Registered User
Join Date: Jul 2004
Location: Belgium
Posts: 17
Skipping Hosts in a Host-file

The way to read ip-address and/or names of hosts from a txt-file is well documented on the VanDyke support site.

However, I took this idea a bit further.

1. The loop that gets the hostnames from the file, checks if the first character on the line is an "'" (apostrophe). If that is the case, the line will be ignored. That way, you can put "comment-lines" in your host-file.
Also, if one or more hosts need to be skipped temporary, it is easy to put an apostrophe in front of the line, and remove it later.

2. If a (big) set of hosts needs to be skipped, I use '[' and ']' to put before and after that set of hostnames (on separate lines) in the txt-file. When the scripts sees a line with '[', it sets the variable b_Skip_Hosts to true. When it encounters a ']', it sets it to false.

Works like a charm
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 04:20 PM.