easyddup a simple upgrade/downgrade utility

Post new topic   Reply to topic    DD-WRT Forum Index -> Contributions Upload
Goto page Previous  1, 2, 3 ... 19, 20, 21
Author Message
Mrutin
DD-WRT Novice


Joined: 06 Mar 2024
Posts: 3

PostPosted: Fri Mar 08, 2024 3:27    Post subject: Reply with quote
Thanks, working fine now.
Currently running a dangerous auto update with easyddup.ini
Code:
EDDUP_ERASE_NVRAM=N
EDDUP_SAVE_SETTINGS=Y
EDDUP_AUTO_CONFIRM=Y
EDDUP_AUTO_SELECT_LATEST=Y
EDDUP_AUTO_SELECT_FILE='asus_rt-ac68u-firmware.trx'
EDDUP_HARDWARE_FOLDER="asus-rt-ac68u"


And a cron job of
Code:
01 01 * * * root /opt/easyddup/easyddup.sh


This will of course break my router if the latest build is bad - which I expect to occur quite often. Any thoughts on how to decrease the risk of using a bad build?

Currently considering a heuristic based on how long the latest build has existed (e.g. more than 10 days should mean nothing horribly wrong with the build in general).
Sponsor
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 373

PostPosted: Fri Mar 08, 2024 15:25    Post subject: Reply with quote
Mrutin wrote:
Currently considering a heuristic based on how long the latest build has existed (e.g. more than 10 days should mean nothing horribly wrong with the build in general).

Good idea. Something like below that defaults to zero and prevents showing bleeding edge builds.

#EDDUP_WAIT_FOR_DAYS=7

If you do something general please share and all could benefit.


Last edited by yoyoma2 on Thu Mar 14, 2024 12:27; edited 1 time in total
Mrutin
DD-WRT Novice


Joined: 06 Mar 2024
Posts: 3

PostPosted: Thu Mar 14, 2024 10:12    Post subject: Reply with quote
Code:
--- easyddup.sh   2024-03-14 08:31:01.774393075 +0100
+++ easyddup.ageverify.sh   2024-03-14 08:33:53.391410260 +0100
@@ -225,6 +225,14 @@
       exit 0
    fi
    selection=$(echo "$builds" | tail -n +$fid | head -n 1)
+   if [ "$EDDUP_AUTO_SELECT_LATEST" == "Y" ] && [ "$EDDUP_AUTO_SELECT_MIN_AGE" -gt "0" ]; then
+      selection_date=$(echo "$selection" | awk -F'-' '{print $3"-"$1"-"$2}')
+      age_seconds=$(( $(date '+%s') - $(date -d "$selection_date" '+%s') ))
+      if [ "$age_seconds" -lt "$EDDUP_AUTO_SELECT_MIN_AGE" ]; then
+         echo "EDDUP_AUTO_SELECT_MIN_AGE is $EDDUP_AUTO_SELECT_MIN_AGE and age is $age_seconds. Quitting"
+         exit 0
+      fi
+   fi
    selected_revision=${selection##*r}
    if [ $buildno -gt $selected_revision ] && \
            [ "$EDDUP_AUTO_SELECT_LATEST" == "Y" -o "$EDDUP_AUTO_SELECT_LATEST" == "y" ];then

And then this in the ini
Code:
EDDUP_AUTO_SELECT_MIN_AGE=259200 #72h in seconds


This version only affects auto updates and prevents the update if the release is too new.
I decided against hiding releases from users as it would not make a difference as they would just see broken releases later (unless the broken release was pulled), this would not help my auto-update scenario.
I realize that this may not match other use cases, so feel free to adapt this.

Also, any reason for not using github? would be nice
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 373

PostPosted: Thu Mar 14, 2024 18:22    Post subject: Reply with quote
New version 0.9.5 (March 14th).

Changes:

Include @Mrutin's feature that allows EDDUP_AUTO_SELECT_LATEST to have a waiting period to avoid automatically installing potentially bad builds. See easyddup.ini.sample for example use:

Code:
EDDUP_AUTO_SELECT_MIN_AGE=259200 #72h in seconds

Thank you @Mrutin, great idea and implementation!

Upgrade automatically with checknewversion.sh or download/install manually.
Goto page Previous  1, 2, 3 ... 19, 20, 21 Display posts from previous:    Page 21 of 21
Post new topic   Reply to topic    DD-WRT Forum Index -> Contributions Upload All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum