get firmware version from working router?

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


Joined: 24 Sep 2015
Posts: 67

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: 1446
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.)

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
inetquestion
DD-WRT User


Joined: 24 Sep 2015
Posts: 67

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 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