Difference between revisions of "NOC:ctwug run"
From CTWUG Wiki
Bigmikedavis (talk | contribs) (New page: == Purpose == == Dependencies == == Script == == WMS == Wug Management System) |
Bigmikedavis (talk | contribs) |
||
Line 4: | Line 4: | ||
== Script == | == Script == | ||
+ | #:if ( [/file find name=is_gametime.txt] != "" ) do=[/file remove is_gametime.txt] | ||
+ | /tool fetch host=noc.ctwug.za.net address=noc.ctwug.za.net src-path=web/api/gametime dst-path=is_gametime.txt mode=http | ||
+ | :delay 1 | ||
+ | :local temp [/file get is_gametime.txt contents] | ||
+ | :local fdisabled no | ||
+ | :if ($temp = 0) do={:set fdisabled yes} | ||
+ | |||
+ | /queue simple | ||
+ | :local qos | ||
+ | :foreach qos in [find disabled!=$fdisabled] do={ | ||
+ | :if ( [:pick [get $qos comment] 0 4] = "AUTO" ) do=[set $qos disabled=$fdisabled] | ||
+ | } | ||
+ | |||
+ | /interface | ||
+ | :local iface | ||
+ | :foreach iface in [find disabled=no] do={ | ||
+ | :if ( [:pick [get $iface comment] 0 4] = "qos;" ) do=[ :set fdisabled no] | ||
+ | } | ||
+ | |||
+ | /ip firewall mangle | ||
+ | :local fw | ||
+ | :foreach fw in [find disabled!=$fdisabled] do={ | ||
+ | :if ( [:pick [get $fw comment] 0 4] = "AUTO" ) do=[set $fw disabled=$fdisabled] | ||
+ | } | ||
== WMS == | == WMS == | ||
[[Wug Management System]] | [[Wug Management System]] |
Revision as of 21:46, 7 November 2012
Contents
Purpose
Dependencies
Script
#:if ( [/file find name=is_gametime.txt] != "" ) do=[/file remove is_gametime.txt] /tool fetch host=noc.ctwug.za.net address=noc.ctwug.za.net src-path=web/api/gametime dst-path=is_gametime.txt mode=http :delay 1 :local temp [/file get is_gametime.txt contents] :local fdisabled no :if ($temp = 0) do={:set fdisabled yes} /queue simple :local qos :foreach qos in [find disabled!=$fdisabled] do={ :if ( [:pick [get $qos comment] 0 4] = "AUTO" ) do=[set $qos disabled=$fdisabled] } /interface :local iface :foreach iface in [find disabled=no] do={ :if ( [:pick [get $iface comment] 0 4] = "qos;" ) do=[ :set fdisabled no] } /ip firewall mangle :local fw :foreach fw in [find disabled!=$fdisabled] do={ :if ( [:pick [get $fw comment] 0 4] = "AUTO" ) do=[set $fw disabled=$fdisabled] }