Author
Message
i8ts17 DD-WRT Novice Joined: 25 Jul 2017 Posts: 6
Posted: Mon Apr 05, 2021 12:04 Post subject: Get firmware date from command line
Hi. When you ssh in you see something like this:
BusyBox v1.33.0 (2021-03-04 02:03:13 +07) built-in shell (ash)
Or at top of GUI:
Firmware: DD-WRT v3.0-r45891 std (03/04/21)
Or uname -a
Linux DD-WRT 4.9.258 #2465 SMP Thu Mar 4 02:00:54 +07 2021 armv7l DD-WRT
I was wondering if we can get it from the command line. Just -> 3/4/21 which is my current.
With:
nvram show 2>&1 | grep -m1 "os_version="
I can get:
os_version=45891
I tried:
x=$(busybox /bin/ash -v)
but it hangs...
Was thinking -> x=$(uname -a)
Then sed,grep,awk it and translate 'Mar' to '03'
but that is a bit much
Is there any nvram var or something I could use to get the date part?
Worked on it but could not get it so thought I'd ask here.
Thanks.. _________________ wrt32000acm
DD-WRT v3.0-r45891 std (03/04/21)
openvpn server
Back to top
Sponsor
i8ts17 DD-WRT Novice Joined: 25 Jul 2017 Posts: 6
Posted: Thu Apr 08, 2021 16:20 Post subject:
Answering my own post. I got it and it was right in front of me. When you SSH in say with Putty at the top it says:
Pre-authentication banner message from server:
| DD-WRT v3.0-r45891 std (c) 2021 NewMedia-NET GmbH
| Release: 03/04/21
| Board: Linksys WRT3200ACM
That info comes from:
/tmp/loginprompt
So:
the_date=$(cat /tmp/loginprompt | sed -n '2 p' | cut -d ' ' -f 2 | tr -s '/' '-')
echo $the_date returns:
03-04-21
Maybe someone will expand on it. Still don't know where DD-WRT gets it. I figure it must set it up internally somehow. _________________ wrt32000acm
DD-WRT v3.0-r45891 std (03/04/21)
openvpn server
Back to top
kernel-panic69 DD-WRT Guru Joined: 08 May 2018 Posts: 14222 Location: Texas, USA
Back to top
egc DD-WRT Guru Joined: 18 Mar 2014 Posts: 12889 Location: Netherlands
Posted: Thu Apr 08, 2021 20:23 Post subject:
kernel-panic69 wrote: The firmware date is set during the compile and build process, if I am not mistaken.
Correct
I have build 46301 running but my date differs as it was build today _________________ Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read): https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Back to top
i8ts17 DD-WRT Novice Joined: 25 Jul 2017 Posts: 6
Posted: Thu Apr 08, 2021 21:28 Post subject:
Thank you for the responses. Understood now. _________________ wrt32000acm
DD-WRT v3.0-r45891 std (03/04/21)
openvpn server
Back to top