Difference between revisions of "NOC:ctwug updated"
From CTWUG Wiki
Bigmikedavis (talk | contribs) (New page: == Purpose == == Dependencies == == Script == == WMS == Wug Management System) |
(→Script) |
||
| Line 4: | Line 4: | ||
== Script == | == Script == | ||
| + | :local fid [/system identity get name] | ||
| + | :local fserial [/system routerboard get serial-number] | ||
| + | :local ffile "ctwug_version.rsc" | ||
| + | :local fpath ("web/api/update?id=".$fid."&serial=".$fserial."&update=1") | ||
| + | :local fpath2 $fpath | ||
| + | :local fpath "" | ||
| + | :for i from=0 to=( [:len $fpath2] - 1) do={ | ||
| + | :local fchar [:pick $fpath2 $i] | ||
| + | :if ( $fchar = " ") do={ | ||
| + | :set fchar "%20" | ||
| + | } | ||
| + | :set fpath ($fpath.$fchar) | ||
| + | } | ||
| + | |||
| + | /tool fetch host=noc.ctwug.za.net address=noc.ctwug.za.net src-path=$fpath dst-path=$ffile mode=http | ||
| + | :delay 1 | ||
| + | :log info [/file get $ffile contents] | ||
== WMS == | == WMS == | ||
[[Wug Management System]] | [[Wug Management System]] | ||
Revision as of 12:11, 15 November 2012
Contents
Purpose
Dependencies
Script
:local fid [/system identity get name]
:local fserial [/system routerboard get serial-number]
:local ffile "ctwug_version.rsc"
:local fpath ("web/api/update?id=".$fid."&serial=".$fserial."&update=1")
:local fpath2 $fpath
:local fpath ""
:for i from=0 to=( [:len $fpath2] - 1) do={
:local fchar [:pick $fpath2 $i]
:if ( $fchar = " ") do={
:set fchar "%20"
}
:set fpath ($fpath.$fchar)
}
/tool fetch host=noc.ctwug.za.net address=noc.ctwug.za.net src-path=$fpath dst-path=$ffile mode=http
:delay 1
:log info [/file get $ffile contents]