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

User avatar
Frequent Visitor
Frequent Visitor
Posts: 57
Joined: Thu May 05, 2005 10:50 pm
Reputation: 4
First RouterOS version: 3.3
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


Who is online

Users browsing this forum: No registered users and 3 guests

It is currently Fri May 27, 2016 3:10 pm