remote nvram backup

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
lazardo
DD-WRT User


Joined: 17 Apr 2014
Posts: 86
Location: SF Bay Area

PostPosted: Wed Jan 02, 2019 7:49    Post subject: remote nvram backup Reply with quote
$ cat ~/bin/nvram
Code:
#!/bin/sh
# fetch nvram binary and human readable
# tested w 35531 K3x mega broadcom, linux environ

# =====================================
ROUTER_NAME=dd-wrt
WORK_DIR=/tmp
TARGET_DIR=~/Downloads/ddwrt/firmware/n66u/

TAG=$( date +%m%d%H%M )
# =====================================

ssh $ROUTER_NAME "
cd $WORK_DIR || exit 1

osvers=\$( nvram get os_version )
type=\$( nvram get DD_BOARD ); type=\${type#* }

nvram show > \$osvers.$ROUTER_NAME.\$type.$TAG.nvrambak.txt
nvram backup \$osvers.$ROUTER_NAME.\$type.$TAG.nvrambak.bin
md5sum \$osvers.$ROUTER_NAME.\$type.$TAG.nvrambak.??? > \$osvers.$ROUTER_NAME.\$type.$TAG.nvrambak.md5
"
scp ${ROUTER_NAME}:${WORK_DIR}/*.$TAG.nvrambak.* $TARGET_DIR &&
ssh $ROUTER_NAME "rm $WORK_DIR/*.$TAG.nvrambak.*"


~/Downloads/ddwrt/firmware/n66u$ nvram
size: 41214 bytes (24322 left)
35531.dd-wrt.RT-N66U.01012336.nvrambak.bin 100% 42KB 1.2MB/s 00:00
35531.dd-wrt.RT-N66U.01012336.nvrambak.md5 100% 154 48.8KB/s 00:00
35531.dd-wrt.RT-N66U.01012336.nvrambak.txt 100% 40KB 1.2MB/s 00:00

~/Downloads/ddwrt/firmware/n66u$ md5sum -c 35531.dd-wrt.RT-N66U.01012336.nvrambak.md5
35531.dd-wrt.RT-N66U.01012336.nvrambak.bin: OK
35531.dd-wrt.RT-N66U.01012336.nvrambak.txt: OK

happy ny to all
Sponsor
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware 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