Page 1 of 1

Why won't this script run correctly?

Posted: Mon Jun 09, 2008 11:39 pm
by REDTDI
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]

Re: Why won't this script run correctly?

Posted: Tue Jun 10, 2008 11:30 am
by mrz
On 3.10 you can get architecture name:
:if ([/system resource get architecture-name] = "powerpc") do={ 
    /tool fetch ...
}