Script for something -------------------- 01. Here is a script to sound an alarm/siren and not just a simple beep. ----------------------------------------------------------------------------- :for c from=1 to=50 step=1 \ do={ \ :set i 15 :set x 1900 :do {\ :beep length=400ms frequency=$x; :delay 25ms :set i ($i - 1); :set x ($x +35) } \ while (($i <16) && ($i >0)) :beep length=0 frequency=0 } ----------------------------------------------------------------------------- 02. If i have not internet, script make beep in NetWAtch - Down - ----------------------------------------------------------------------------- / tool netwatch add host=213.xxx.xxx.x timeout=1s interval=1m up-script="" down-script=":log info \"GATEWAY \ \n :set i 15 \=50 step=1 \\ \n :beep length=400ms frequency=\$x; \ \n \ :set x (\$x +35) \n :beep length=0 \) && (\$i >0)) \n}" comment="" disabled=no ----------------------------------------------------------------------------- [admin@RouTer] tool netwatch> and script is ----------------------------------------------------------------------------- :log info "GATEWAY Problem No INTERNET" :for c from=1 to=50 step=1 \ do={ \ :set i 15 :set x 1900 :do {\ :beep length=400ms frequency=$x; :delay 25ms :set i ($i - 1); :set x ($x +35) } \ while (($i <16) && ($i >0)) :beep length=0 frequency=0 } ----------------------------------------------------------------------------- But how to make this script to beep until ISP recover my connection and if ISP recover connection , script mast stop beep ----------------------------------------------------------------------------- :for i from=1000 to=3000 step=80 do={:beep length=10ms frequency=$i; :delay 10ms;} :for i from=1000 to=2800 step=80 do={:beep length=10ms frequency=$i; :delay 10ms;} :for i from=2800 to=1000 step=-80 do={:beep length=10ms frequency=$i; :delay 10ms;} ----------------------------------------------------------------------------- 03. Monitoring Traffik ----------------------------------------------------------------------------- :global recBits 0; :do { :global recBits ( [/interface monitor-traffic ether1 as-value ]->"received-bits-per-second") ; } while=(recBits<=10000); # now you can execute other script ----------------------------------------------------------------------------- 04. Clearning WEb Proxy script ----------------------------------------------------------------------------- NAT PROXY / ip firewall nat add chain=dstnat src-address=10.0.0.0/16 dst-address=0.0.0.0/0 \ protocol=tcp dst-port=80 action=redirect to-ports=3126 comment="Proxy" disabled=no Proxy-off / system script add name="Proxy-off" source="/ip firewall nat set \[/ip firewall nat find \ comment=\"Proxy\"\] disable=yes \n/ip web-proxy set enabled=no" \ policy=ftp,reboot,read,write,policy,test,winbox,password Proxy-limpacache / system script add name="Proxy-limpacache" source="/ip web-proxy clear-cache" \ policy=ftp,reboot,read,write,policy,test,winbox,password Proxy-on / system script add name="Proxy-on" source="/ip web-proxy set enabled=yes \n/ip firewall nat \ set \[/ip firewall nat find comment=\"Proxy\"\] disable=no \n" \ policy=ftp,reboot,read,write,policy,test,winbox,password scheduler proxy-off / system scheduler add name="control-proxy-off" on-event=Proxy-off start-date=nov/29/2006 \ start-time=02:30:00 interval=15d comment="" disabled=no scheduler proxy-limpacache / system scheduler add name="control-proxy-limpacache" on-event=Proxy-limpacache \ start-date=nov/29/2006 start-time=02:31:00 interval=15d comment="" disabled=no scheduler proxy-on / system scheduler add name="controle-proxy-on" on-event=Proxy-on start-date=nov/29/2006 \ start-time=02:40:00 interval=15d comment="" disabled=no ----------------------------------------------------------------------------- 05. backup User Manager ----------------------------------------------------------------------------- /system scheduler add name="backup_userman_database" on-event="/tool \ user-manager database save name=userman" start-date=jan/01/1970 \ start-time=15:00:00 interval=1d comment="" disabled=no ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- /system script add name=ebackup source={/system backup save name=([/system identity get name] . "-" . \ [:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . \ [:pick [/system clock get date] 4 6]); /tool e-mail send to="youremail@yourdomain.com" \ subject=([/system identity get name] . " Backup " . [/system clock get date]) \ file=([/system identity get name] . "-" . [:pick [/system clock get date] 7 11] . \ [:pick [/system clock get date] 0 3] . [:pick [/system clock get date] 4 6] . \ ".backup"); :delay 10; /file rem [/file find name=([/system identity get name] . \ "-" . [:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . \ [:pick [/system clock get date] 4 6] . ".backup")]; :log info ("System Backup emailed at " . \ [/sys cl get time] . " " . [/sys cl get date])} ----------------------------------------------------------------------------- 06. Resolve DNS ----------------------------------------------------------------------------- :foreach a in=[/ip firewall address-list find list=testlist] do={ /ip firewall address-list set $a address=[:resolve [/ip firewall address-list get $a comment]] } :foreach a in=[/ip firewall address-list find address=0.0.0.0] do={ /ip firewall address-list set $a disabled=yes ----------------------------------------------------------------------------- ######################################################################## Documentation,Editing,Optimization by baratev.sourceforge.net ########################################################################