How To - Clear Script Run-Counters
RouterOS Scripting and API

1 post   •   Page 1 of 1
User avatar
rgraham
newbie
 
Posts: 46
Joined: Thu May 05, 2005 10:50 pm
Location: USA Minneapolis, Minnesota

How To - Clear Script Run-Counters

by rgraham » Wed Jan 06, 2010 11:29 pm

# Clear Script Run Counters
# Counters can not be cleared but you can remove and add them back

:local sname
:local snumber
:local sruncount
:local ssource
:local spolicy

/system script

#Get Script Number
:foreach snumber in=[find run-count > 0] do={
# Get Script Number
:set sname [get value-name=name number=$snumber];
# Get Script Run-Count
:set sruncount [get value-name=run-count number=$snumber];
# Get Script Source
:set ssource [get value-name=source number=$snumber];
# Get Script Policy
:set spolicy [get value-name=policy number=$snumber];


#Remove Script
remove $snumber
#Add Script
add name=$sname source=$ssource policy=$spolicy

}
[color=#4000BF][i]Randy[/i][/color]

1 post   •   Page 1 of 1

Who is online

Users browsing this forum: Yahoo [Bot] and 17 guests

It is currently Thu Dec 18, 2014 4:23 pm