Community discussions

MikroTik App
 
davidw
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 91
Joined: Fri Apr 27, 2007 11:11 pm

Upgrade Script not running

Fri Aug 14, 2009 5:05 am

Hi There,

When I create and run this script the upgrade part works but the reboot does not.

/system script
add name=script1 policy=ftp,reboot,read,write,policy,test,winbox,password,sniff source="/system routerboard upgrade\r\n/system reboot\r\n"

I have to create 2 separate scripts to get the job done ?

Have tried all sorts of ";" delay 1's combination etc

Any ideas ?

Cheers
 
davidw
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 91
Joined: Fri Apr 27, 2007 11:11 pm

Re: Upgrade Script not running

Fri Aug 14, 2009 6:18 am

For anyone who is interested I got it to work this way.

/system script add name="upgrade" source="/system routerboard upgrade"
/system script run upgrade
/system reboot
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8383
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Upgrade Script not running

Fri Aug 14, 2009 11:11 am

For anyone who is interested I got it to work this way.

/system script add name="upgrade" source="/system routerboard upgrade"
/system script run upgrade
/system reboot
wo_Ot

why not just

/system routerboard upgrade
/system reboot

?..
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
davidw
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 91
Joined: Fri Apr 27, 2007 11:11 pm

Re: Upgrade Script not running

Sat Aug 15, 2009 4:26 pm

For anyone who is interested I got it to work this way.

/system script add name="upgrade" source="/system routerboard upgrade"
/system script run upgrade
/system reboot
wo_Ot

why not just

/system routerboard upgrade
/system reboot

?..

Tried that but it just did not seem to work in fact thats what I tried the very first time.
The system routerboard upgrade command ran but the reboot did not happen.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8383
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Upgrade Script not running

Sat Aug 15, 2009 7:12 pm

but you still do reboot manually - what has been changed?.. %)
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
davidw
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 91
Joined: Fri Apr 27, 2007 11:11 pm

Re: Upgrade Script not running

Sun Aug 16, 2009 1:23 am

I should mention that I am running these commands via ssh remotely, not via local terminal.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8383
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Upgrade Script not running

Sun Aug 16, 2009 1:24 am

hmmm... are you waiting for reply, or simply send both commands?..
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
davidw
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 91
Joined: Fri Apr 27, 2007 11:11 pm

Re: Upgrade Script not running

Sun Aug 16, 2009 1:36 am

Just sending both commands
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8383
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Upgrade Script not running

Sun Aug 16, 2009 3:22 pm

maybe that's the problem...
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
ManyX
Member Candidate
Member Candidate
Posts: 111
Joined: Sat Jan 07, 2006 12:48 pm
Location: PolanD

Re: Upgrade Script not running

Tue Jul 10, 2012 1:27 am

You may import this script from scheduler
/import upgrade-fw.rsc 
upgrade-fw.rsc
:if ([/system routerboard get current-firmware] != [/system routerboard get upgrade-firmware]) do={
:log error "Bios need upgrade";
/system script add name="upgrade" source="/system routerboard upgrade";
/system script run upgrade;
:delay 5;
/system script remove [find name=upgrade];
:delay 5;
/system reboot} else={:log warning "Nothing"}
regards.
BD

Who is online

Users browsing this forum: lucasimo88 and 29 guests