A scripts Repository

Hello all!

I noticed a lot of people asking for a script resource place, so here I am trying to start one. I also found it a bit confusing myself getting started with the scripts, but they are extremely useful.

So:

  1. disable p2p connections

add name=“stop_dc1” source=“ip firewall rule forward enable [/ip firewall rule forward find action=drop]
\n”
policy=ftp,reboot,read,write,policy,test

for RouterOS v2.9 it looks like this:

add name=“stop_dc1” source=“ip firewall filter enable [/ip firewall filter find action=drop]
\n”
policy=ftp,reboot,read,write,policy,test

  1. enable p2p connections

add name=“start_dc1” source=“ip firewall rule forward disable [/ip firewall rule forward find
action=drop]
\n” policy=ftp,reboot,read,write,policy,test

I have to add that for these two scripts you have to have a firewall rule:
/ ip firewall rule forward
add p2p=all-p2p action=drop comment=“” disabled=no

  1. send backup email

add name=“backup_mail” source=“system backup save name=email
\n/tool e-mail send
to="me@mydomaint.abc" from="someone@somewhere.abc" server="213.157.170.43" subject=([/system
identity get name] . " " . [/system clock get time] . " " . [/system clock get date] . "
Backup") file=email.backup” policy=ftp,reboot,read,write,policy,test

These scripts are of course used with schedulers:

/ system scheduler
add name=“sched_start_dc1” on-event=start_dc1 start-date=sep/21/2005 start-time=23:00:00 interval=1d
comment=“” disabled=no
add name=“sched_backup_mail” on-event=backup_mail start-date=sep/23/2005 start-time=07:30:00 interval=7d
comment=“” disabled=no
add name=“sched_stop_dc1” on-event=stop_dc1 start-date=sep/22/2005 start-time=07:00:00 interval=1d comment=“”
disabled=no

Please add some of yours as well and comments are welcome.

Regards,
Radu

Please would you be so kind to give me a script to reset the traffic counters for all the hotspot users?

thanks in advance

#Reset user counters:
#-------------------
/ system script
add name=“rst-hspot-cnt” source=“/ip hotspot user reset-counters”
policy=ftp,reboot,read,write,policy,test,winbox,password
/
/
#Schedule user counter reset daily at midnight:
#---------------------------------------------
/ system scheduler
add name=“rst-hspot-user-cnt” on-event=rst-hspot-cnt start-date=feb/25/2006
start-time=00:00:01 interval=1d comment=“” disabled=no
/

add all scripts to the wiki, that is what it is for …

http://wiki.mikrotik.com/wiki/Main_Page

Done - I know what a wiki is for, just didn’t know it was there…thanks for the heads-up.

:sunglasses: