Community discussions

MikroTik App
 
brianlewis
Member Candidate
Member Candidate
Topic Author
Posts: 134
Joined: Tue Jul 20, 2004 10:54 am
Location: Irvine, CA

Basic scripts not working on 6.44.1 (work in 6.43.13)

Sat Mar 23, 2019 12:11 am

I have some basic scripts that we use to switch between two different hotspots. They are simply enabling an disabling various items and changing SSID. On 6.43.13 they work great! Upgrade to 6.44.1 and they don't execute at all. You can select to RUN SCRIPT and the RUN COUNT increases by 1 but none of the settings change. Downgrade the router back to 6.43.13 and scripts start working flawlessly. If I copy/paste into terminal window the commands work just fine on 6.44.1

Script 1:
/ip dhcp-client
set 0 disabled=yes
/ip route
set 2 disabled=no
/interface wireless
set [ find default-name=wlan1 ] disabled=no name=wlan2 ssid=ATT4G security-profile=default

Script 2:
/ip dhcp-client
set 0 disabled=no
/ip route
set 2 disabled=yes
/interface wireless
set [ find default-name=wlan1 ] disabled=no name=wlan2 ssid=chris security-profile=chris
 
sid5632
Long time Member
Long time Member
Posts: 553
Joined: Fri Feb 17, 2017 6:05 pm

Re: Basic scripts not working on 6.44.1 (work in 6.43.13)

Sat Mar 23, 2019 3:33 am

You can't use "set 0" and "set 2" and such like in scripts.
You have to do it using "find", as on the wireless bit.
 
brianlewis
Member Candidate
Member Candidate
Topic Author
Posts: 134
Joined: Tue Jul 20, 2004 10:54 am
Location: Irvine, CA

Re: Basic scripts not working on 6.44.1 (work in 6.43.13)

Sat Mar 23, 2019 2:17 pm

set 0 and set 2 have been working fine since 3.x days. As long as the interface # listed on PRINT doesn't change I'm able to use it without issue on 6.43.13 in a script or under terminal mode
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: Basic scripts not working on 6.44.1 (work in 6.43.13)

Sat Mar 23, 2019 3:42 pm

Using numbered items instead of [find ...] was never correct.
Maybe it finally stopped working completely, so that the situation is clear.
Use a proper [find] command, add something unique to each item (e.g. a comment) if required.
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1782
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: Basic scripts not working on 6.44.1 (work in 6.43.13)

Sat Mar 23, 2019 10:16 pm

Original post did mention "If I copy/paste into terminal window the commands work just fine on 6.44.1" ... So it still works just not in the script.
Permissions maybe?
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: Basic scripts not working on 6.44.1 (work in 6.43.13)

Sun Mar 24, 2019 1:16 am

Original post did mention "If I copy/paste into terminal window the commands work just fine on 6.44.1" ... So it still works just not in the script.
Using numbered items is valid in the terminal window but not in scripts.
 
sid5632
Long time Member
Long time Member
Posts: 553
Joined: Fri Feb 17, 2017 6:05 pm

Re: Basic scripts not working on 6.44.1 (work in 6.43.13)

Tue Mar 26, 2019 1:39 am

set 0 and set 2 have been working fine since 3.x days. As long as the interface # listed on PRINT doesn't change I'm able to use it without issue on 6.43.13 in a script or under terminal mode
Why did you bother asking if you knew what the answer was better than anyone else then?

Who is online

Users browsing this forum: No registered users and 20 guests