What's new

MerlinAU MerlinAU v1.2.6 - The Ultimate Firmware Auto-Updater (**Thread closed due to age**)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Yes, now it does 🤭
I read it wrong back when I installed and enabled it on everything.
So router on "0 0 * * *" nodes on "30 0 * * *" to avoid conflict to download the Firmware update to the nodes.

As I was updating the schedule, got this....

Though I do occsionally get this on the router and on either node, when launching the script even though automatic checks are enabled on all of them.
In this case it was the other node, (the one I manually updated, didn't get this message last night as I launched the script to manually launch the update) before answering "No", checked cron and the schedule was set. Then answered "No" and renabled it then updated the schedule.
View attachment 58295

Before schedule modification (on node)
View attachment 58296

After (on node)
View attachment 58297

Minor, and random, not consistent, but thought I should share...
Doesn't seem to interrupt process because the scheduled cron job is still there...

Thanks,
Other than my scheduling snafu it ran perfectly!

Thank you for confirming it updated everything perfectly.

No worries on the scheduling snafu, makes me think I should add some type of messaging around the postpone feature.
It's really meant for people who want MerlinAU checking all the time (i.e nightly as I recommended).
But need some time to review logs, or maybe go on vacation for a month, etc.

If your scheduling specific days, you generally don't need to use the postpone feature and can set it to zero since the script will only run on those days anyways.
Now as you saw, you can still use the postpone feature and schedule specific day, but yeah you need to do a bit of mental math to figure out when to schedule your cron if you want it to happen the same night the postpone is over.

As for scheduling myself I have it check nightly, and my node is about 15 minutes offset from the primary, I start with the node first, then 15 minutes later the primary is scheduled.
Updates usually only take about 3 to 4 minutes including the reboot so 15 minutes I think is safe to avoid conflict.

As for the cron behavior I'll need to think on this a bit more, I haven't seen this on my side, am I understanding correctly that your saying you got the message on MerlinAU to enable automatic checks, and before making any selection (yes or no) you checked the crons and saw MerlinAU listed?
You did this with another SSH window or by force closing MerlinAU? Then you made your selection when running MerlinAU, modified the schedule and then re-enabled the automatic update checks?
 
Last edited:
Thank you for confirming it updated everything perfectly.

No worries on the scheduling snafu, makes me think I should add some type of messaging around the postpone feature. It's really meant for people who want MerlinAU checking all the time (i.e nightly as I recommended). But need some time to review logs, or maybe go on vacation for a month, etc.

If your scheduling specific days, you generally don't need to use the postpone feature and can set it to zero since the script will only run on those days anyways.

Now as you saw, you can still use the postpone feature and schedule specific day, but yeah you need to do a bit of mental math to figure out when to schedule your cron if you want it to happen the same night the postpone is over.

As for scheduling myself I have it check nightly, and my node is about 15 minutes offset from the primary, I start with the node first, then 15 minutes later the primary is scheduled.

Updates usually only take about 3 to 4 minutes including the reboot so 15 minutes I think is safe to avoid conflict.

As for the cron behavior I'll need to think on this a bit more, I haven't seen this on my side, am I understanding correctly that your saying you got the message on MerlinAU to enable automatic checks, and before making any selection (yes or no) you checked the crons and saw MerlinAU listed? You did this with another SSH window or by force closing MerlinAU?

Then you made your selection when running MerlinAU, modified the schedule and then re-enabled the automatic update checks?
Yes!, all around.

As you’ll see in first post on this, the screenshot has it enabled.
upgrade not launched.jpg


All the other devices have it exactly the same way, but yes I opened another SSH window to double check.
When I manually update, I do the nodes first, now that I think about it. You’re right, whole process from launch, backup, download, apply, reboot is very quick.

Unfortunately for troubleshooting on this, I can’t make it happen on demand, very randomly do I get this. Which of course makes it difficult to track down.
I know there was a issue with cron jobs disappearing/colliding etc. but this isn't that as, the job is always there. The script just doesn't pick up that it's enabled when the it starts up when it happens.
What I've yet to do, wil try it next time this comes up. I'll break out of the script and relaunch it to see if it happens, then.
 
Yes!, all around.

As you’ll see in first post on this, the screenshot has it enabled.
View attachment 58305

All the other devices have it exactly the same way, but yes I opened another SSH window to double check.
When I manually update, I do the nodes first, now that I think about it. You’re right, whole process from launch, backup, download, apply, reboot is very quick.

Unfortunately for troubleshooting on this, I can’t make it happen on demand, very randomly do I get this. Which of course makes it difficult to track down.
I know there was a issue with cron jobs disappearing/colliding etc. but this isn't that as, the job is always there. The script just doesn't pick up that it's enabled when the it starts up when it happens.
What I've yet to do, wil try it next time this comes up. I'll break out of the script and relaunch it to see if it happens, then.

The code first checks if the firmware updates is enabled on the firmware:

Code:
FW_UpdateCheckState="$(nvram get firmware_check_enable)"

Do you have automatic update checks disabled in the WebUI for some reason?

1714437097558.png
 
Last edited:
Yes!, all around.

As you’ll see in first post on this, the screenshot has it enabled.
View attachment 58305

All the other devices have it exactly the same way, but yes I opened another SSH window to double check.
When I manually update, I do the nodes first, now that I think about it. You’re right, whole process from launch, backup, download, apply, reboot is very quick.

Unfortunately for troubleshooting on this, I can’t make it happen on demand, very randomly do I get this. Which of course makes it difficult to track down.
I know there was a issue with cron jobs disappearing/colliding etc. but this isn't that as, the job is always there. The script just doesn't pick up that it's enabled when the it starts up when it happens.
What I've yet to do, wil try it next time this comes up. I'll break out of the script and relaunch it to see if it happens, then.

Also, I know you mentioned it was random, but have you noticed if it only happens after a firmware update and reboot?
Or does it happen just randomly completely unrelated to if a new firmware was recently flashed?
 
The code first checks if the firmware updates is enabled on the firmware:

Code:
FW_UpdateCheckState="$(nvram get firmware_check_enable)"

Do you have automatic update checks disabled in the WebUI for some reason?
View attachment 58314
Enabled in the WebUI

1714435953761.png
 
Also, I know you mentioned it was random, but have you noticed if it only happens after a firmware update and reboot?
Or does it happen just randomly completely unrelated to if a new firmware was recently flashed?
No, random, can happen with the Router or Nodes. I have seen it pop up as I perform an update, but that's because I launch the script to perform the Update (UP). This was the first release I handed over the controls to MerlinAU. I don't think there's a dependency there.

Happens randomly, random devices at launch. Have seen it happen more ofren on the nodes, but never both at the same time. Less often at the router. But no pattern that I've been able to track/notice.
 
...

As I was updating the schedule, got this....

Though I do occsionally get this on the router and on either node, when launching the script even though automatic checks are enabled on all of them.
In this case it was the other node, (the one I manually updated, didn't get this message last night as I launched the script to manually launch the update) before answering "No", checked cron and the schedule was set. Then answered "No" and renabled it then updated the schedule.

Before schedule modification (on node)
Your "Before schedule modification" screenshot shows that there was an error in the script path used by the cron job:

0 0 * * 0 sh /./jffs/scripts/MerlinAU.sh run_now #MerlinAU#

During startup, the shell script looks for its path in the scheduled cron job as follows:

sh /jffs/scripts/MerlinAU.sh run_now

Since the paths did not match, the code concludes that the cron job is not defined and prompts you to create the cron again.

After (on node)
The "After" screenshot shows the correct script path for the new scheduled cron job:

30 0 * * 0 sh /jffs/scripts/MerlinAU.sh run_now #MerlinAU#

So for some reason, the same code is creating the paths differently, which is odd.

Can you explain in detail how exactly you were launching the shell script manually when the problem occurred? That might provide some clues about what's going on.
 
Is this @thelonelycoder or @ExtremeFiretop for the upgrade downgrade arrow mishap?

View attachment 58394

This would be @thelonelycoder but tbh I thought this was already fixed in his dev build:


Maybe I misunderstood.
 
Your "Before schedule modification" screenshot shows that there was an error in the script path used by the cron job:

0 0 * * 0 sh /./jffs/scripts/MerlinAU.sh run_now #MerlinAU#

During startup, the shell script looks for its path in the scheduled cron job as follows:

sh /jffs/scripts/MerlinAU.sh run_now

Since the paths did not match, the code concludes that the cron job is not defined and prompts you to create the cron again.


The "After" screenshot shows the correct script path for the new scheduled cron job:

30 0 * * 0 sh /jffs/scripts/MerlinAU.sh run_now #MerlinAU#

So for some reason, the same code is creating the paths differently, which is odd.

Can you explain in detail how exactly you were launching the shell script manually when the problem occurred? That might provide some clues about what's going on.
Script launched from AMTM / 8 everytime.
Manual was the update I did because the scheduled update didn't happen when I thought it would (my bad), MerlinAU / 1 / and "Y" if there's an update, before changing the schedule to have MerlinAU run nightly.

This has happened with the last few releases, but not consistently at every launch (odd), haven't had it happend with 1.1.2, but if it does I now kbow what to look for...
Can't even fathom what might have changed it. But going to try some of the scripts I've got on the nodes (to narrow it down). SCMerlin (via SSH), MerlinAU, BACKUPMON - short list. Come to think about it, SCMerlin does let you list cron jobs.

Node
1714622775761.png


The other Node - AHA!
1714622877386.png


And there it is, the extra /./ you mentioned, now as to what is triggering it? One of the 4 AMTM scripts, RouterDate, LEDcontrol_on, LEDcontrol_off or ScriptsUpdateNotification?
Same 4 run on the Router as well! Nodes pretty much stay hands off, so something running on them is doing it.

Launched MerlinAU on the offending node, and sure enough prompted to setup the automation. Re-enabled it, Cron job modified with the extra /./ removed.
Now the hunt is on!

Node has been hands off since the last schedule modification a few posts back. Staying hands off after this last change, except for the occasional "cru l" to hunt this down
The plot thickens!
 
Script launched from AMTM / 8 everytime.
Manual was the update I did because the scheduled update didn't happen when I thought it would (my bad), MerlinAU / 1 / and "Y" if there's an update, before changing the schedule to have MerlinAU run nightly.

This has happened with the last few releases, but not consistently at every launch (odd), haven't had it happend with 1.1.2, but if it does I now kbow what to look for...
Can't even fathom what might have changed it. But going to try some of the scripts I've got on the nodes (to narrow it down). SCMerlin (via SSH), MerlinAU, BACKUPMON - short list. Come to think about it, SCMerlin does let you list cron jobs.

Node
View attachment 58395

The other Node - AHA!
View attachment 58396

And there it is, the extra /./ you mentioned, now as to what is triggering it? One of the 4 AMTM scripts, RouterDate, LEDcontrol_on, LEDcontrol_off or ScriptsUpdateNotification?
Same 4 run on the Router as well! Nodes pretty much stay hands off, so something running on them is doing it.

Launched MerlinAU on the offending node, and sure enough prompted to setup the automation. Re-enabled it, Cron job modified with the extra /./ removed.
Now the hunt is on!

Node has been hands off since the last schedule modification a few posts back. Staying hands off after this last change, except for the occasional "cru l" to hunt this down
The plot thickens!
Well there goes that theory, ran each manually.
Nothing Changed!
1714624700993.png
 
That's entirely my fault :mad:. Reminder to self: Do not edit files on the company Laptop when on vacation and call it done - and then not sync back to development version when back home.
Fix will be out soon.

Thanks buddy for confirming I'm not crazy! Haha
 
I don't want to seem greedy, but I have a request to consider if it is not too much trouble.

It would be nice if the MerlinAU screen showed me when an update is going to happen. I can see there is an update available, I can see the last notification date, and I can see the postponement days setting. So in my head I can sort of figure out how long I have left to get ready. But it would be really nice if it just told me. Either a specific date, or even just the number of postponement days remaining would be helpful. Perhaps an extra line at the top saying something like Auto Update scheduled for nn/nn/nn, or Auto Update in nn days.
 
I don't want to seem greedy, but I have a request to consider if it is not too much trouble.

It would be nice if the MerlinAU screen showed me when an update is going to happen. I can see there is an update available, I can see the last notification date, and I can see the postponement days setting. So in my head I can sort of figure out how long I have left to get ready. But it would be really nice if it just told me. Either a specific date, or even just the number of postponement days remaining would be helpful. Perhaps an extra line at the top saying something like Auto Update scheduled for nn/nn/nn, or Auto Update in nn days.

Hi @nlurker

Did you have a look at my GitHub page by chance? Or was this a total coincidence that you requested this while I have PR 205 already pending to try and address this? Haha.

I have a PR im working on to factor in the cron in the runtime estimate. Still needs some work but I started it some hours ago sometime this morning :)

It's on the radar.
 
Hi @nlurker

Did you have a look at my GitHub page by chance? Or was this a total coincidence that you requested this while I have PR 205 already pending to try and address this? Haha.

I have a PR im working on to factor in the cron in the runtime estimate. Still needs some work but I started it some hours ago sometime this morning :)

It's on the radar.
Total coincidence, I had no idea. I just noticed there is a new release and that the information I need most is not there. Thanks for reading my mind and working on it before I asked.

OK, I just looked at your PR. Your estimate is displayed when selecting option 1. I was thinking that it should be displayed at the top where the new version available message is (without having to run the F/W update check again).
 
Last edited:
sorry, but this script not fit for purpose title says "The Ultimate Firmware Auto-Updater" but its not true I just want it update router firmware no matter what. logs says 2024-05-05 00:00:14 Warning: Found high-risk phrases in the change-log, checked change-log nothing red flags for me. Everything enabled by default will not auto update anything
 
sorry, but this script not fit for purpose title says "The Ultimate Firmware Auto-Updater" but its not true I just want it update router firmware no matter what.

@Tadas. The script works exactly as designed.

logs says 2024-05-05 00:00:14 Warning: Found high-risk phrases in the change-log, checked change-log nothing red flags for me.

You somehow managed to missed the only instructions from the logs that includes a next step, to be exact it says:

"Warning: Found high-risk phrases in the change-log."
"Please run script interactively to approve the upgrade."

Did you try and run the flash interactively instead of via cron as requested?
Did you try to disable the changelog feature from the advanced options?

To me, this sounds like a problem with how you have this setup and how you expect this to run.

If there are high risk phrases in the changelogs (which there was in the last release) you need to run it interactively, or disable the changelog check to allow it to run via cron.

Did you read the Wiki around the changelog feature?

And this thread around the changelog feature?

Let me know if you have any specific questions.
 
Last edited:
I've just experienced the "high-risk phrases" workflow, and have some gentle suggestions for improvement.

I'd prefer if the change-log scan happened before the postponement period. Postpone the flash only, not the download and scan. This will allow you to inform me right away that the flash is blocked. I'll have the rest of the postponement period to review the change-log and register my approval.

What happened instead is, I had already reviewed the change-log and didn't notice anything of concern or high-risk. After the postponement period had passed, I was puzzled that no update had occurred. I ran the update check to see what was wrong and only then was I told that I need to approve the update. So I reviewed the change-log again and still could not tell what the high risk item is. So I approved the update, and it proceeded to flash immediately, interrupting my network. I need to approve during the day and flash later in the night at cron time.

I hope this makes sense. Please let me know if I am doing something wrong, or if other users did not have this same problem.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top