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

1 post   •   Page 1 of 1
User avatar
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


1 post   •   Page 1 of 1

Who is online

Users browsing this forum: Baidu [Spider] and 10 guests

It is currently Wed Jan 28, 2015 4:21 am