Community discussions

MikroTik App
 
rion
just joined
Topic Author
Posts: 1
Joined: Fri Feb 03, 2023 8:50 am

Script working only in terminal, but not on system>scripts

Fri Feb 03, 2023 8:55 am

Hi guys,
/ip/dhcp-server/network/remove numbers=0
This script will run on terminal, but when I put it on the scripts menu, it will not run.

It did run like once twice only. After that not anymore.

using RB1100Dx4 os v7.7
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Script working only in terminal, but not on system>scripts

Sun Feb 05, 2023 10:00 pm

You should not use number in script. That is just some temporary number.
In script you must change number with find.

Example find interface name, find comment or other unique with what to delete.


----------------------------------------------------------------------------------------
Use Splunk> to log/monitor your MikroTik Router(s). See link below. :mrgreen:

MikroTik->Splunk
Last edited by Jotne on Sun Feb 12, 2023 9:49 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Script working only in terminal, but not on system>scripts

Mon Feb 06, 2023 11:37 am

What made unique the network is the address pool, you must use that

(is a string, you must use " " !!!)
/ip dhcp-server network remove [find where address="192.168.0.0/24"]

If you want delete all (that probably is what you want to do), simply
/ip dhcp-server network remove [find]

If you want delete the first on the result list (useless, why???), just for example
/ip dhcp-server network remove ([find]->0)

Who is online

Users browsing this forum: ko00000000001 and 25 guests