I need a script to execute the followed commands:
-system telnet 0.0.0.1
(after that i must type a password)
-[my pass]
I want to do this automatically with a script
Can a script do this?
Sorry for my English
I need a script to execute the followed commands:
-system telnet 0.0.0.1
(after that i must type a password)
-[my pass]
I want to do this automatically with a script
Can a script do this?
Sorry for my English
Yes a script can do this.
http://www.mikrotik.com/docs/ros/2.9/system/scripting
Look for delay-time.
Sorry my friend, but how i can import the pass?
For the first one i must write in the script:
/system telnet 0.0.0.1
Then, how it takes the pass?
:put 8975 (this is my password)
sorry but i’ m a little bit ignorant
I’m not exactly sure on that one but here is what i would try…
:put “password” \r
Thank u very much.
It works when i write:
/system telnet 0.0.0.1
:put “8975”
Now i need to continue the script.
The next command i want to typed after that is :
/enable
(and after that again pass)
:put “5552”
But this is not working.
Witch is the correct formulation?
Please, help me, i need this script…
another password after connecting to the machine? two passwords? is this other machine a RouterOS?
When you are sending a /enable command using a script to a different box you are going to want to do :put “/enable”
Man, thank u very much.
Here it is:
/system telnet 0.0.0.1
:put “8975”
:put “/enable”
(and now i want to give another pass so i write)
:put {:put “5552”}
:put “/clear”
The last 2 lines are not working.
The script is running but it doesn’t do what i want,
so i suppose that something in the 2 last lines is not correct
I would try to make it more comprehensible.
In a new terminal on a mikrotik i write these commands:
-system telnet 0.0.0.1
-(after i write this, i must type a password so the pass o type is: )8975
-enable
-(after enable i must type again pass which is: )5552
-clear ip
So i write with your help this script to do this job:
/system telnet 0.0.0.1
:put “8975”
:put “/enable”
:put ":put “5552” "
:put ":put “/clear ip” "
But it’s not working.
Where is the error?
Does anybody knows how to write this script correct?
Sorry, double post
And sorry for my English. I’m not very good at it
I don’t think you will get far trying to script a telnet session from MT to another box… never tried myself, but I doubt the :put works that way.
Have you tried?
/system telnet 0.0.0.1
:put “8975”
:put “/enable”
:put “5552”
:put “/clear ip”
No my friend ![]()
The problem is with the 2 last lines.
Without them the scrip is running
How we can put the second password???
/system telnet 0.0.0.1
:put “8975”
:put “/enable”
:put “:put 5552”
:put “:put /clear ip”
How about?
No ![]()
It is not working
Your script ends at this line
/system telnet 0.0.0.1
And that is it. It stops here. /system telnet … is a command, that has already ended when you do :put “8975”. I do not understand, how do you determine that problems is with last two lines. Problem is already in first two lines. You can not put or print anything in /system script.
I suggest you tu use TCL or EXPECT scripts. They are ment for that.
yes exactly, you cannot make a script connect to another router and issue commands on that side.
Does anybody knows who i can make a script which can run these commands?
Can anybody write this to me?
I’ll be very grateful.
I don’t know where is exactly the problem but i need it.
So if someone knows how to make this script running, he helps me a lot
If you have linux OS, expect should be in repositories. You just need to install it. If you run MS Windows OS, try to look here: http://expect.nist.gov/ There are also examples how to do this trick.