get firmware version from working router?

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> General Questions
Author Message
inetquestion
DD-WRT Novice


Joined: 24 Sep 2015
Posts: 20

PostPosted: Thu Jun 25, 2020 17:32    Post subject: get firmware version from working router? Reply with quote
This works... Just checking to see if there is an easier way?

curl -s 192.168.1.1 | perl -e 'while(<>) { if ($_ =~ m/DD-WRT.*-r(\d+)/sg) { print $1; exit; }}'
Sponsor
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 927
Location: Appalachian mountains, USA

PostPosted: Thu Jun 25, 2020 18:13    Post subject: Reply with quote
Look in /tmp/loginprompt for the login banner that appears when you connect using ssh/PuTTY, etc.

There are lots of crazy ways to extract it, of course. Example:
Code:
ssh root@192.168.1.1 ' ' 2>&1 | sed -nE '1s/.*-r([0-9]{5}) .*/\1/p'

(Note that there's an important space between the first pair of single quotes.)

_________________
Five Linksys WRT1900ACSv2's on 42926, 44048
VLANs, multiple VAPs, NAS, client-mode travel router, OpenVPN client/PBR (AirVPN), wireguard/PBR (AzireVPN), two DNSCrypt servers (incl Quad9) routed through OpenVPN.
inetquestion
DD-WRT Novice


Joined: 24 Sep 2015
Posts: 20

PostPosted: Thu Jun 25, 2020 18:53    Post subject: Reply with quote
merging the two, like this more than my original. :)

curl -s 192.168.1.1 | sed -nE 's/.*-r([0-9]{5}).*/\1/p'
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> General Questions 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 can attach files in this forum
You can download files in this forum