diff --git a/scripts/v6/ch10-01-bad-script.rsc b/scripts/v6/ch10-01-bad-script.rsc index d5a024d..5863b08 100644 --- a/scripts/v6/ch10-01-bad-script.rsc +++ b/scripts/v6/ch10-01-bad-script.rsc @@ -4,7 +4,7 @@ :foreach s in=$w do={ :local i [:resolve $s]; - :local p [/ping $i count=3]; + :local p [/ping $i count=3 ]; :local u [/tool fetch url=("https://$s") mode=https http-method=get \ as-value keep-result=no]; diff --git a/scripts/v6/ch10-02-bad-script.rsc b/scripts/v6/ch10-02-bad-script.rsc index 4e4c1cf..d914d85 100644 --- a/scripts/v6/ch10-02-bad-script.rsc +++ b/scripts/v6/ch10-02-bad-script.rsc @@ -13,7 +13,7 @@ :local i [:resolve $s]; # try pinging the IP address of this site - :local p [/ping $i count=3]; + :local p [/ping $i count=3 ]; # try fetching the web page of this site :local u [/tool fetch url=("https://$s") mode=https http-method=get \ diff --git a/scripts/v6/ch10-03-bad-script.rsc b/scripts/v6/ch10-03-bad-script.rsc index ca840fc..c64f5e5 100644 --- a/scripts/v6/ch10-03-bad-script.rsc +++ b/scripts/v6/ch10-03-bad-script.rsc @@ -13,7 +13,7 @@ :local IpAddress [:resolve $SiteName]; # try pinging the IP address of this site - :local PingResult [/ping $IpAddress count=3]; + :local PingResult [/ping $IpAddress count=3 ]; # try getting the web page of this site :local UrlFetch [/tool fetch url=("https://$SiteName") mode=https \ diff --git a/scripts/v6/ch10-04-bad-script.rsc b/scripts/v6/ch10-04-bad-script.rsc index e7f0fdc..91b6404 100644 --- a/scripts/v6/ch10-04-bad-script.rsc +++ b/scripts/v6/ch10-04-bad-script.rsc @@ -1,10 +1,7 @@ -# filename: ch10-04-bad-script.rsc -# +:global Filename "ch10-04-bad-script.rsc" # A simple script to perform a series of tests on a # list of web sites. -:global Filename "ch10-04-bad-script.rsc"; - # function to log error message :global LogMessageFunc do={ :global Filename; @@ -21,7 +18,7 @@ # check arg type str of correct length passed if (([:typeof $WebSiteName]!="str") or \ - ([:len $WebSiteName] < 6)) do={ + ([:len value=$WebSiteName] < 6)) do={ $LogMessageFunc ("DnsResolveFunc: arg value $WebSiteName not \ a valid string!"); } @@ -50,7 +47,7 @@ # check arg type str of correct length passed if (([:typeof $SiteName] != "str") or \ - ([:len $SiteName] < 6)) do={ + ([:len value=$SiteName] < 6)) do={ $LogMessageFunc ("GetWebPageFunc: arg value $SiteName not a \ valid string!"); } diff --git a/scripts/v6/ch10-05-error_check.rsc b/scripts/v6/ch10-05-error_check.rsc index eb3948e..11c35ea 100644 --- a/scripts/v6/ch10-05-error_check.rsc +++ b/scripts/v6/ch10-05-error_check.rsc @@ -1,7 +1,7 @@ -# filename: ch10-05-error-check.rsc +# ch10-05-error-check.rsc :local WebSites { "badname1234.com"; "google.com"}; :foreach SiteName in=$WebSites do={ :local SiteIpAddress [:resolve $SiteName]; :put "Site IP for $SiteName is $SiteIpAddress"; -} +} \ No newline at end of file diff --git a/scripts/v6/ch10-06-error_check.rsc b/scripts/v6/ch10-06-error_check.rsc index 32f0d9b..411d986 100644 --- a/scripts/v6/ch10-06-error_check.rsc +++ b/scripts/v6/ch10-06-error_check.rsc @@ -1,4 +1,4 @@ -# filename: ch10-06-error-check.rsc +# ch10-06-error-check.rsc :local WebSites { "badname1234.com"; "google.com"}; :foreach SiteName in=$WebSites do={ :do { @@ -7,4 +7,4 @@ } on-error={ :put "Name lookup failed for $SiteName"; } -} +} \ No newline at end of file diff --git a/scripts/v6/ch10-07-bad-script.rsc b/scripts/v6/ch10-07-bad-script.rsc index 19ba9ef..8144789 100644 --- a/scripts/v6/ch10-07-bad-script.rsc +++ b/scripts/v6/ch10-07-bad-script.rsc @@ -1,9 +1,6 @@ -# filename: ch10-07-bad-script.rsc -# -# A simple script to perform a series of tests on a -# list of web sites. - -:global Filename "ch10-07-bad-script.rsc"; +:global Filename "ch10-07-bad-script.rsc" +# A script to perform a series of tests on a +# list of web sites. # function to log error messages :global LogMessageFunc do={ @@ -21,7 +18,7 @@ # check arg type str of correct length passed :if (([:typeof $WebSiteName] != "str") or \ - ([:len $WebSiteName] < 6)) do={ + ([:len value=$WebSiteName] < 6)) do={ $LogMessageFunc ("DnsResolveFunc: arg value $WebSiteName not \ a valid string!"); @@ -67,7 +64,7 @@ # check arg type str of correct length passed :if (([:typeof $SiteName] != "str") or \ - ([:len $SiteName] < 6)) do={ + ([:len value=$SiteName] < 6)) do={ $LogMessageFunc ("GetWebPageFunc: arg value $SiteName not a \ valid string!"); :return "*** test failed ***"; diff --git a/scripts/v6/ch10-08-bad-script.rsc b/scripts/v6/ch10-08-bad-script.rsc index 30aa87f..e978be6 100644 --- a/scripts/v6/ch10-08-bad-script.rsc +++ b/scripts/v6/ch10-08-bad-script.rsc @@ -1,10 +1,7 @@ -# filename: ch10-08-bad-script.rsc -# -# A simple script to perform a series of tests on a +:global Filename "ch10-08-bad-script.rsc" +# A script to perform a series of tests on a # list of web sites. -:global Filename "ch10-08-bad-script.rsc"; - # set DEBUG to "true" for script debugging output, # "false" for normal operation :global DEBUG false; @@ -37,7 +34,7 @@ $DebugFunc "Checking arg data type is correct"; :if (([:typeof $WebSiteName] != "str") or \ - ([:len $WebSiteName] < 6)) do={ + ([:len value=$WebSiteName] < 6)) do={ :local ErrorMsg "DnsResolveFunc: arg value $WebSiteName \ not a valid string!"; $LogMessageFunc $ErrorMsg; @@ -88,10 +85,10 @@ # check arg type str of correct length passed if (([:typeof $SiteName] != "str") or \ - ([:len $SiteName] < 6)) do={ + ([:len value=$SiteName] < 6)) do={ $LogMessageFunc ("GetWebPageFunc: arg value $SiteName not a \ valid string!"); - :return { "duration"="*** test failed ***" } + :return { "duration"="*** test failed ***" }; } do { @@ -100,7 +97,7 @@ } on-error { $LogMessageFunc ("GetWebPageFunc: unable to retrieve site: \ $SiteName !"); - :return { "duration"="*** test failed ***" } + return { "duration"="*** test failed ***" }; } } diff --git a/scripts/v6/ch10-09-simple-pause.rsc b/scripts/v6/ch10-09-simple-pause.rsc index bb2520d..ffb7efd 100644 --- a/scripts/v6/ch10-09-simple-pause.rsc +++ b/scripts/v6/ch10-09-simple-pause.rsc @@ -1,7 +1,7 @@ -# filename: ch10-09-simple-pause.rsc +# ch10-09-simple-pause.rsc # A simple script that includes a 2 second pause :put "Hello we're going to pause now..."; :delay 2; -:put "Pause complete. We're all done now!"; +:put "Pause complete. We're all done now!"; \ No newline at end of file diff --git a/scripts/v6/ch10-10-add-remove-vlans.rsc b/scripts/v6/ch10-10-add-remove-vlans.rsc index 67aaa17..c5d877f 100644 --- a/scripts/v6/ch10-10-add-remove-vlans.rsc +++ b/scripts/v6/ch10-10-add-remove-vlans.rsc @@ -1,4 +1,4 @@ -# filename: ch10-10-add-remove-vlans.rsc +# ch10-10-add-remove-vlans.rsc # a script to add and remove 50 VLANs to/fromon-error={ # a Mikrotik router interface @@ -24,4 +24,4 @@ # add VLAN to LAN interface :local VlanName "VLAN$VlanId"; /interface vlan remove "$VlanName"; -} +} \ No newline at end of file diff --git a/scripts/v6/ch10-11-add-remove-vlans.rsc b/scripts/v6/ch10-11-add-remove-vlans.rsc index 8cf2a61..49d912a 100644 --- a/scripts/v6/ch10-11-add-remove-vlans.rsc +++ b/scripts/v6/ch10-11-add-remove-vlans.rsc @@ -1,4 +1,4 @@ -# filename: ch10-11-add-remove-vlans.rsc +# ch10-11-add-remove-vlans.rsc # a script to add and remove 50 VLANs to/from # a Mikrotik router interface @@ -20,4 +20,4 @@ # add VLAN to LAN interface :local VlanName "VLAN$VlanId"; /interface vlan remove "$VlanName"; -} +} \ No newline at end of file diff --git a/scripts/v6/ch10-12-add-remove-vlans.rsc b/scripts/v6/ch10-12-add-remove-vlans.rsc index 2d601f4..ffa3ce0 100644 --- a/scripts/v6/ch10-12-add-remove-vlans.rsc +++ b/scripts/v6/ch10-12-add-remove-vlans.rsc @@ -1,4 +1,4 @@ -# filename: ch10-12-add-remove-vlans.rsc +# ch10-12-add-remove-vlans.rsc # a script to add and remove 50 VLANs to/from # a Mikrotik router interface @@ -28,4 +28,4 @@ } }]; -:put "Remove loop time: $RemoveLoopTime"; +:put "Remove loop time: $RemoveLoopTime"; \ No newline at end of file diff --git a/scripts/v7/ch10-01-bad-script.rsc b/scripts/v7/ch10-01-bad-script.rsc index d5a024d..5863b08 100644 --- a/scripts/v7/ch10-01-bad-script.rsc +++ b/scripts/v7/ch10-01-bad-script.rsc @@ -4,7 +4,7 @@ :foreach s in=$w do={ :local i [:resolve $s]; - :local p [/ping $i count=3]; + :local p [/ping $i count=3 ]; :local u [/tool fetch url=("https://$s") mode=https http-method=get \ as-value keep-result=no]; diff --git a/scripts/v7/ch10-02-bad-script.rsc b/scripts/v7/ch10-02-bad-script.rsc index 4e4c1cf..d914d85 100644 --- a/scripts/v7/ch10-02-bad-script.rsc +++ b/scripts/v7/ch10-02-bad-script.rsc @@ -13,7 +13,7 @@ :local i [:resolve $s]; # try pinging the IP address of this site - :local p [/ping $i count=3]; + :local p [/ping $i count=3 ]; # try fetching the web page of this site :local u [/tool fetch url=("https://$s") mode=https http-method=get \ diff --git a/scripts/v7/ch10-03-bad-script.rsc b/scripts/v7/ch10-03-bad-script.rsc index ca840fc..c64f5e5 100644 --- a/scripts/v7/ch10-03-bad-script.rsc +++ b/scripts/v7/ch10-03-bad-script.rsc @@ -13,7 +13,7 @@ :local IpAddress [:resolve $SiteName]; # try pinging the IP address of this site - :local PingResult [/ping $IpAddress count=3]; + :local PingResult [/ping $IpAddress count=3 ]; # try getting the web page of this site :local UrlFetch [/tool fetch url=("https://$SiteName") mode=https \ diff --git a/scripts/v7/ch10-04-bad-script.rsc b/scripts/v7/ch10-04-bad-script.rsc index 5e4242f..91b6404 100644 --- a/scripts/v7/ch10-04-bad-script.rsc +++ b/scripts/v7/ch10-04-bad-script.rsc @@ -1,9 +1,6 @@ -# filename: ch10-04-bad-script.rsc -# +:global Filename "ch10-04-bad-script.rsc" # A simple script to perform a series of tests on a -# list of web sites. - -:global Filename "ch10-04-bad-script.rsc"; +# list of web sites. # function to log error message :global LogMessageFunc do={ @@ -21,7 +18,7 @@ # check arg type str of correct length passed if (([:typeof $WebSiteName]!="str") or \ - ([:len $WebSiteName] < 6)) do={ + ([:len value=$WebSiteName] < 6)) do={ $LogMessageFunc ("DnsResolveFunc: arg value $WebSiteName not \ a valid string!"); } @@ -50,7 +47,7 @@ # check arg type str of correct length passed if (([:typeof $SiteName] != "str") or \ - ([:len $SiteName] < 6)) do={ + ([:len value=$SiteName] < 6)) do={ $LogMessageFunc ("GetWebPageFunc: arg value $SiteName not a \ valid string!"); } diff --git a/scripts/v7/ch10-05-error_check.rsc b/scripts/v7/ch10-05-error_check.rsc index eb3948e..11c35ea 100644 --- a/scripts/v7/ch10-05-error_check.rsc +++ b/scripts/v7/ch10-05-error_check.rsc @@ -1,7 +1,7 @@ -# filename: ch10-05-error-check.rsc +# ch10-05-error-check.rsc :local WebSites { "badname1234.com"; "google.com"}; :foreach SiteName in=$WebSites do={ :local SiteIpAddress [:resolve $SiteName]; :put "Site IP for $SiteName is $SiteIpAddress"; -} +} \ No newline at end of file diff --git a/scripts/v7/ch10-06-error_check.rsc b/scripts/v7/ch10-06-error_check.rsc index 32f0d9b..411d986 100644 --- a/scripts/v7/ch10-06-error_check.rsc +++ b/scripts/v7/ch10-06-error_check.rsc @@ -1,4 +1,4 @@ -# filename: ch10-06-error-check.rsc +# ch10-06-error-check.rsc :local WebSites { "badname1234.com"; "google.com"}; :foreach SiteName in=$WebSites do={ :do { @@ -7,4 +7,4 @@ } on-error={ :put "Name lookup failed for $SiteName"; } -} +} \ No newline at end of file diff --git a/scripts/v7/ch10-07-bad-script.rsc b/scripts/v7/ch10-07-bad-script.rsc index 19ba9ef..8144789 100644 --- a/scripts/v7/ch10-07-bad-script.rsc +++ b/scripts/v7/ch10-07-bad-script.rsc @@ -1,9 +1,6 @@ -# filename: ch10-07-bad-script.rsc -# -# A simple script to perform a series of tests on a -# list of web sites. - -:global Filename "ch10-07-bad-script.rsc"; +:global Filename "ch10-07-bad-script.rsc" +# A script to perform a series of tests on a +# list of web sites. # function to log error messages :global LogMessageFunc do={ @@ -21,7 +18,7 @@ # check arg type str of correct length passed :if (([:typeof $WebSiteName] != "str") or \ - ([:len $WebSiteName] < 6)) do={ + ([:len value=$WebSiteName] < 6)) do={ $LogMessageFunc ("DnsResolveFunc: arg value $WebSiteName not \ a valid string!"); @@ -67,7 +64,7 @@ # check arg type str of correct length passed :if (([:typeof $SiteName] != "str") or \ - ([:len $SiteName] < 6)) do={ + ([:len value=$SiteName] < 6)) do={ $LogMessageFunc ("GetWebPageFunc: arg value $SiteName not a \ valid string!"); :return "*** test failed ***"; diff --git a/scripts/v7/ch10-08-bad-script.rsc b/scripts/v7/ch10-08-bad-script.rsc index 30aa87f..e978be6 100644 --- a/scripts/v7/ch10-08-bad-script.rsc +++ b/scripts/v7/ch10-08-bad-script.rsc @@ -1,10 +1,7 @@ -# filename: ch10-08-bad-script.rsc -# -# A simple script to perform a series of tests on a +:global Filename "ch10-08-bad-script.rsc" +# A script to perform a series of tests on a # list of web sites. -:global Filename "ch10-08-bad-script.rsc"; - # set DEBUG to "true" for script debugging output, # "false" for normal operation :global DEBUG false; @@ -37,7 +34,7 @@ $DebugFunc "Checking arg data type is correct"; :if (([:typeof $WebSiteName] != "str") or \ - ([:len $WebSiteName] < 6)) do={ + ([:len value=$WebSiteName] < 6)) do={ :local ErrorMsg "DnsResolveFunc: arg value $WebSiteName \ not a valid string!"; $LogMessageFunc $ErrorMsg; @@ -88,10 +85,10 @@ # check arg type str of correct length passed if (([:typeof $SiteName] != "str") or \ - ([:len $SiteName] < 6)) do={ + ([:len value=$SiteName] < 6)) do={ $LogMessageFunc ("GetWebPageFunc: arg value $SiteName not a \ valid string!"); - :return { "duration"="*** test failed ***" } + :return { "duration"="*** test failed ***" }; } do { @@ -100,7 +97,7 @@ } on-error { $LogMessageFunc ("GetWebPageFunc: unable to retrieve site: \ $SiteName !"); - :return { "duration"="*** test failed ***" } + return { "duration"="*** test failed ***" }; } } diff --git a/scripts/v7/ch10-09-simple-pause.rsc b/scripts/v7/ch10-09-simple-pause.rsc index bb2520d..ffb7efd 100644 --- a/scripts/v7/ch10-09-simple-pause.rsc +++ b/scripts/v7/ch10-09-simple-pause.rsc @@ -1,7 +1,7 @@ -# filename: ch10-09-simple-pause.rsc +# ch10-09-simple-pause.rsc # A simple script that includes a 2 second pause :put "Hello we're going to pause now..."; :delay 2; -:put "Pause complete. We're all done now!"; +:put "Pause complete. We're all done now!"; \ No newline at end of file diff --git a/scripts/v7/ch10-10-add-remove-vlans.rsc b/scripts/v7/ch10-10-add-remove-vlans.rsc index a93e4ff..390cffd 100644 --- a/scripts/v7/ch10-10-add-remove-vlans.rsc +++ b/scripts/v7/ch10-10-add-remove-vlans.rsc @@ -1,4 +1,4 @@ -# filename: ch10-10-add-remove-vlans.rsc +# ch10-10-add-remove-vlans.rsc # a script to add and remove 50 VLANs to/from # a Mikrotik router interface @@ -24,4 +24,4 @@ # add VLAN to LAN interface :local VlanName "VLAN$VlanId"; /interface/vlan remove "$VlanName"; -} +} \ No newline at end of file diff --git a/scripts/v7/ch10-11-add-remove-vlans.rsc b/scripts/v7/ch10-11-add-remove-vlans.rsc index 8cf2a61..49d912a 100644 --- a/scripts/v7/ch10-11-add-remove-vlans.rsc +++ b/scripts/v7/ch10-11-add-remove-vlans.rsc @@ -1,4 +1,4 @@ -# filename: ch10-11-add-remove-vlans.rsc +# ch10-11-add-remove-vlans.rsc # a script to add and remove 50 VLANs to/from # a Mikrotik router interface @@ -20,4 +20,4 @@ # add VLAN to LAN interface :local VlanName "VLAN$VlanId"; /interface vlan remove "$VlanName"; -} +} \ No newline at end of file diff --git a/scripts/v7/ch10-12-add-remove-vlans.rsc b/scripts/v7/ch10-12-add-remove-vlans.rsc index 2d601f4..ffa3ce0 100644 --- a/scripts/v7/ch10-12-add-remove-vlans.rsc +++ b/scripts/v7/ch10-12-add-remove-vlans.rsc @@ -1,4 +1,4 @@ -# filename: ch10-12-add-remove-vlans.rsc +# ch10-12-add-remove-vlans.rsc # a script to add and remove 50 VLANs to/from # a Mikrotik router interface @@ -28,4 +28,4 @@ } }]; -:put "Remove loop time: $RemoveLoopTime"; +:put "Remove loop time: $RemoveLoopTime"; \ No newline at end of file