[SCRIPT] CLI update auto-download and flash latest beta

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Contributions Upload
Author Message
osm0sis
DD-WRT Novice


Joined: 28 Jul 2021
Posts: 11
Location: Canada

PostPosted: Thu Aug 05, 2021 1:03    Post subject: [SCRIPT] CLI update auto-download and flash latest beta Reply with quote
Worked out a little script to paste into telnet to make CLI updates a bit easier:
Code:

cliupdate() {
  local build_latest ddwrt firmware n platform year;
  ddwrt=http://download1.dd-wrt.com/dd-wrtv2/downloads/betas;
  year=2021;
  build_latest=$(wget -qO- $ddwrt/$year | grep href | tail -n1 | cut -d\" -f2);
  platform=tplink_archer-c7-v4;
  firmware=tplink_archer-c7-v4.bin;
  read -p "Download and flash DD-WRT \"$build_latest\" (y/n)? " n;
  case $n in
    Y|y)
      rm -f /tmp/$firmware;
      wget -P /tmp $ddwrt/$year/$build_latest$platform/$firmware \
        && write /tmp/$firmware linux;
    ;;
  esac;
  if [ $? -eq 0 ]; then
    read -p "Reboot (y/n)? " n;
    case $n in
      Y|y) reboot;;
    esac;
  fi;
}

cliupdate;


I have it set up for my TP-Link Archer C7 v4, but simply change out the platform= and firmware= values for your device and you should be set!

Enjoy! Cool
Sponsor
RobrPatty
DD-WRT Novice


Joined: 06 Jun 2016
Posts: 23

PostPosted: Mon Nov 29, 2021 8:41    Post subject: where in telenet Reply with quote
Not sure where to paste this script.
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 3255

PostPosted: Mon Nov 29, 2021 10:08    Post subject: Reply with quote
https://www.chiark.greenend.org.uk/~sgtatham/putty/

Telnet, or SSH if configured, router IP username root.
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 278
Location: All over the webs

PostPosted: Mon Nov 29, 2021 13:15    Post subject: Reply with quote
You dont paste the script per say.

You copy it to /tmp on the router, make it executable and then run it.
Each time you want to upgrade again you must do same, since anything on tmp will disapear after each reboot.

TBH that script could be slightly tweaked. =)

Take care.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @
#style_it_themes_public:matrix.org or
#dd-wrt_non_official:matrix.org
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 11210
Location: Texas, USA

PostPosted: Mon Nov 29, 2021 16:48    Post subject: Reply with quote
Details on the tweaks would be wonderful, and quite helpful. If said tweaks are valid, of course, lol.
_________________
Official Forum Rules, Guidelines & Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware‽
DON'T use Chromium-based browsersRTFM/STFW TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is‽
Please DO NOT PM me with questions; Ask in the forum. ---------------------- Linux User #377467 counter.li.org / linuxcounter.net
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 894
Location: Hung Hom, Hong Kong

PostPosted: Thu Dec 02, 2021 15:13    Post subject: Re: [SCRIPT] CLI update auto-download and flash latest beta Reply with quote
osm0sis wrote:
Worked out a little script to paste into telnet to make CLI updates a bit easier:
Code:
....
read -p "Download and flash DD-WRT \"$build_latest\" (y/n)? " n;
  case $n in
    Y|y)
      rm -f /tmp/$firmware;
      wget -P /tmp $ddwrt/$year/$build_latest$platform/$firmware \
        && write /tmp/$firmware linux;
    ;;
  esac;
....


Didn't see any error checking (e.g. download size vs listed size)? Smile

Sometimes, the file size of a firmware was too small, indicating an error. If you flashed it, the router might be bricked.

It would be great if all builds have CRC checksum as a companion text files. Until then... Smile


_________________
Router: Asus RT-N18U (rev. A1)

May the Force and farces be with you! Live long and proper!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 11210
Location: Texas, USA

PostPosted: Thu Dec 02, 2021 17:31    Post subject: Reply with quote
We will likely never see cryptographic signing, md5, sha256, crc verification information for DD-WRT ever again. Don't hold your breath. FWIW, I know how much longer it would take to parse md5sums on the number of firmware images currently built just by calculating how long it takes to do so on a full run of FreshTomato MIPS and ARM images. "Time is money".
_________________
Official Forum Rules, Guidelines & Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware‽
DON'T use Chromium-based browsersRTFM/STFW TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is‽
Please DO NOT PM me with questions; Ask in the forum. ---------------------- Linux User #377467 counter.li.org / linuxcounter.net
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum 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