Community discussions

MikroTik App
 
REDTDI
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Fri May 28, 2004 9:41 pm

Why won't this script run correctly?

Mon Jun 09, 2008 11:39 pm

I'm trying to automate getting a package onto a router using either fetc or /system upgrade and neither of them seem to work when embedded in an auto.rsc file or a plain script file. They both work fine when just pasted into a terminal. Is what I'm trying to do even possible?

The script is below.

Thanks,
Ken

:global architecture 0
:global architecture [:find [/sys resource get cpu] "4Kc"]
:if ($architecture>0) do [/tool fetch add=192.168.1.1 port=9198 mode=ftp path=routeros-mipsle-3.10.npk user=admin pass=blahblah]

:global architecture 0
:global architecture [:find [/sys resource get cpu] "Geode"]
:if ($architecture>0) do [/tool fetch add=192.168.1.1 port=9198 mode=ftp path=routeros-x86-3.10.npk user=admin pass=blahblah]

:global architecture 0
:global architecture [:find [/sys resource get cpu] "24K"]
:if ($architecture>0) do [/tool fetch add=192.168.1.1 port=9198 mode=ftp path=routeros-x86-3.10.npk user=admin pass=blahblah]

:global architecture 0
:global architecture [:find [/sys resource get cpu] "e300"]
:if ($architecture>0) do [/tool fetch add=192.168.1.1 port=9198 mode=ftp path=routeros-x86-3.10.npk user=admin pass=blahblah]
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7188
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Why won't this script run correctly?

Tue Jun 10, 2008 11:30 am

On 3.10 you can get architecture name:
:if ([/system resource get architecture-name] = "powerpc") do={ 
    /tool fetch ...
}

Who is online

Users browsing this forum: No registered users and 18 guests