I have some scripts that run and use fixed variable names, scripts such as checking if an interface is up end-to-end rather than just relying on the first hop. Many of these scripts have multiple sections that are all identical with 1 number changed in the variable name, i.e.......(in pseudo code)
Code: Select all
PingResultISP1 = (ping UpCheckISP1 interface=ISP1)
if PingResultISP1 < 1 then (increase route distance ISPRoute1)
PingResultISP2 = (ping UpCheckISP2 interface=ISP2)
if PingResultISP2 < 1 then (increase route distance ISPRoute2)
PingResultISP3 = (ping UpCheckISP3 interface=ISP3)
if PingResultISP3 < 1 then (increase route distance ISPRoute3)
Code: Select all
NumberOfGateways = 3
for n = 1 to 3
PingResultISP[n] = (ping UpCheckISP[n] interface=ISP[n])
if PingResultISP[n] < 1 then (increase route distance ISPRoute[n])
next n