Community discussions

MikroTik App
 
hrober
newbie
Topic Author
Posts: 41
Joined: Fri Jun 02, 2006 3:32 pm
Location: Brazil

name[=value] - get value

Mon Nov 06, 2006 3:56 pm

How get value of the name[=value] into script ?

IE.
{
/ip address add address=$ipaddress interface=ether1
}
The line command:
myscript ip=192.168.0.2
(sorry for bad english)
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Mon Nov 06, 2006 6:53 pm

I don't believe you can use arguments to a script. But you can assign global variables.

ie:

:global IPAddr 192.168.0.2

then

/ip address add address=$IPAddr interface=ether1

Does that help? :global variables live as long as the router is running. Once rebooted you lose them.
 
Biggs
just joined
Posts: 24
Joined: Mon Sep 26, 2005 5:24 pm

Wed Nov 15, 2006 5:38 pm

Would it be possible to have a startup script that we can set global variables into?

Who is online

Users browsing this forum: No registered users and 9 guests