thelonelycoder
Part of the Furniture
amtm never lies, I had a stern talk to about this and other behaviors. You know, things one does when a script comes of age.Yes. Running option "[5] Update NVRAM Save/Restore Utility Menu" fixed the situation.
amtm never lies, I had a stern talk to about this and other behaviors. You know, things one does when a script comes of age.Yes. Running option "[5] Update NVRAM Save/Restore Utility Menu" fixed the situation.
nvram-user-sample.sh is an example script that creates a tar backup of the jffs directory created by nvram-save.sh. The script nvram-save.sh will call a user exit script nvram-user.sh at the end of execution. You can rename nvram-user-sample.sh to nvram-user.sh to create the tar file or perform extra processing on the backup files such as move or copy the backup files to another location.I appreciate the efforts in writing the script. Helping a lot.
I don't know if there is a possibility to export to .cfg and .tar extensions (jffs)
Code:settings_$(nvram get buildno)_$(nvram get extendno).cfgI see a way to export to the ownCloud.Code:jffs_$(nvram get buildno)_$(nvram get extendno).tar
The profile.add entries get created during installation. If you manually moved the location, the profile.add entries still point to the old location. You will need to edit /jffs/configs/profile.add to reflect the new location and open up a new SSH session for the shortcuts to be recognized.I changed my USB drive scripts from a USB thumb drive (SNB) to an SSD (WD1tb), by copying all scripts / directories to my Linux box, then copied them to the SSD. I get an error trying to get "nsru" to change to the SSD direcory.
I checked /jffs/configs/profile.add and the alias is there, yet when I type "nsru" it give me the error that it cannot find the old USB thumb drive. How to correct this, please.
Code:usr_name@RT-AC86U-4608:/jffs/configs# cat profile.add alias nsru='cd /tmp/mnt/WD1tb/nsru' alias nsrum='sh /jffs/scripts/nsrum'Code:usr_name@RT-AC86U-4608:/tmp/home/root# nsru -sh: cd: can't cd to /tmp/mnt/SNB/nsru
You can use the dhcpstaticlist.sh script to convert dhcp static leases from being stored in nvram to dnsmasq.conf.add to free up additional nvram space.@Xentrk I'm not having any problems after doing a dirty conversion from ASUS 385.10000 to 384.15, except my NVRAM is dangerously full. After doing some manual cleanup, I managed to get about 2K free. But due to my many dirty updates, I suspect there's many more settings that are left-over from old ASUS days.
I've run your latest nvram_save.sh script. So, I'm wondering if I could purge junk by doing an nvram erase, followed immediately by running the generated nvram-restore-nnnnnnnnnnn.sh . Then commiting.
In my ignorance, I'm hoping the restore script only restores known (current) NVRAM name/value pairs. This assumption comes from the way you've grouped the name/values in specific categories. I also assume that the saved settings are all that are necessary for normal operation. Possibly all or some of the packages might need to be re-installed - but that isn't a big deal.
Sorry if this has already been covered. I've been overwhelmed by all the new stuff I'm dealing with since switching to Merlin and installing all these scripts.
Good. I appreciate your guidance.nvram-user-sample.sh is an example script that creates a tar backup of the jffs directory created by nvram-save.sh. The script nvram-save.sh will call a user exit script nvram-user.sh at the end of execution. You can rename nvram-user-sample.sh to nvram-user.sh to create the tar file or perform extra processing on the backup files such as move or copy the backup files to another location.
The nvram-save.sh creates a shell script (nvram-restore-202002101120_RT-AC88U-8248.sh) that nvram-restore.sh runs which contains the nvram values saved. The format is not the same as the .cfg backup file saved by the firmware.
That is what I state, /jffs/configs/profile shows the correct pathThe profile.add entries get created during installation. If you manually moved the location, the profile.add entries still point to the old location. You will need to edit /jffs/configs/profile.add to reflect the new location and open up a new SSH session for the shortcuts to be recognized.
Using the menu to uninstall will remove the entries from profile.add. Then, run install for the new location. The new location will then get added to profile.add.
user@RT-AC86U-4608:/tmp/home/root# cat /jffs/configs/profile.add
alias nsru='cd /tmp/mnt/WD1tb/nsru'
alias nsrum='sh /jffs/scripts/nsrum'
user@RT-AC86U-4608:/tmp/home/root# nsru
-sh: cd: can't cd to /tmp/mnt/SNB/nsru
-sh: cd: can't cd to /tmp/mnt/SNB/nsru
I didn't have any issues with my testing that caused the failure you describe. Did this occur on an RT-AC86U? I don't have an HND router to test on. But do have remote access to a AC86U at a site I support. But I can't take the router down for testing as it is a business.@Xentrk
FYI ...you have missed the additional NVRAM variables for the VPN Clients - without them, any restore will truncate the VPN Client Custom Configuration GUI, resulting in the failure of the affected VPN Client from correctly initialising.
Also should 'dns_local_cache' be defined?
vpn_clientX_cn
vpn_clientX_gw
What happens when you type:That is what I state, /jffs/configs/profile shows the correct path
typing "nsru" at the command prompt give this wrong path of /tmp/mnt/SNB/ which was the old thumb drive and does not exist any more.Code:user@RT-AC86U-4608:/tmp/home/root# cat /jffs/configs/profile.add alias nsru='cd /tmp/mnt/WD1tb/nsru' alias nsrum='sh /jffs/scripts/nsrum'
Code:user@RT-AC86U-4608:/tmp/home/root# nsru -sh: cd: can't cd to /tmp/mnt/SNB/nsru
I often have 3-5 ssh sessions open, I have closed them all, rebooted the router, still the error shows
Code:-sh: cd: can't cd to /tmp/mnt/SNB/nsru
ls -d -- /tmp/mnt/*/nsru
Additionally, if incorporating a new router to replace an existing router, even of the same model, the firmware Save/Restore options cannot be used and a fresh setup would be required.
[System - Basic]
@time_zone_dst
time_zone
time_zone_dstoff
sh save-mynvram.sh dhcp_hostnames dhcp_staticlist
Saving dhcp_hostnames
Saving dhcp_staticlist
Backing up previous restore script to /tmp/mnt/AC88U/nsru/restore-mynvram.sh.bak
Saved 2 NVRAM variable(s)
Run /tmp/mnt/AC88U/nsru/restore-mynvram.sh to restore your saved settings
sh save-mynvram.sh dhcp_hostnames dhcp_staticlist
Saving NVRAM variable dhcp_hostnames
Saving NVRAM variable dhcp_staticlist
Backing up previous restore script to /tmp/mnt/AC88U/nsru/restore-mynvram.sh.bak
Saved 0 /jffs/nvram variable(s)
Saved 2 NVRAM variable(s)
Run /tmp/mnt/AC88U/nsru/restore-mynvram.sh to restore your saved settings
# sh save-mynvram.sh dhcp_hostnames dhcp_staticlist
Saving /jffs/nvram/dhcp_hostnames
Skipping dhcp_hostnames (empty or does not exist)
Saving /jffs/nvram/dhcp_staticlist
Saving NVRAM variable dhcp_staticlist
Backing up previous restore script to /tmp/mnt/AC88U/nsru/restore-mynvram.sh.bak
Saved 2 /jffs/nvram variable(s)
Saved 1 NVRAM variable(s)
Run /tmp/mnt/AC88U/nsru/restore-mynvram.sh to restore your saved settings
What happens when you type:
Code:ls -d -- /tmp/mnt/*/nsru
usr_name@RT-AC86U-4608:/tmp/home/root# ls -d -- /tmp/mnt/*/nsru
/tmp/mnt/WD1tb/nsru
The following will remove any references to nsru or nsrum in /jffs/configs/profile.add and create the new short cuts. Copy/paste and run in a command line.Code:usr_name@RT-AC86U-4608:/tmp/home/root# ls -d -- /tmp/mnt/*/nsru /tmp/mnt/WD1tb/nsru
# Remove all nsru short cuts
sed -i '/nsru/d' "/jffs/configs/profile.add"
# Create new short cut for nsru
echo "alias nsru='cd /tmp/mnt/WD1tb/nsru'" >>/jffs/configs/profile.add
# Create new short cut for nsrum
echo "alias nsrum='cd /jffs/scripts/nsrum'" >>/jffs/configs/profile.add
Thanks. Fixed.Typo: "skiping" -> "skipping".Code:MD5 hash of clear-maclist.sh matches - skiping download clear-maclist.sh
Thanks for the reply. We are still going in circles. Those lines to be added after deletion are what is already there!The following will remove any references to nsru or nsrum in /jffs/configs/profile.add and create the new short cuts. Copy/paste and run in a command line.
Test by opening a new SSH session and typing the commands nsru and nsrum.Code:# Remove all nsru short cuts sed -i '/nsru/d' "/jffs/configs/profile.add" # Create new short cut for nsru echo "alias nsru='cd /tmp/mnt/WD1tb/nsru'" >>/jffs/configs/profile.add # Create new short cut for nsrum echo "alias nsrum='cd /jffs/scripts/nsrum'" >>/jffs/configs/profile.add
user@RT-AC86U-4608:/tmp/home/root# cat /jffs/configs/profile.add
alias nsru='cd /tmp/mnt/WD1tb/nsru'
alias nsrum='sh /jffs/scripts/nsrum'
user@RT-AC86U-4608:/tmp/home/root# nsru
-sh: cd: can't cd to /tmp/mnt/SNB/nsru
Ah. Okay. I don't have an answer at the moment then. Have you ever had aliases work in /jffs/configs/profile.add before?Thanks for the reply. We are still going in circles. Those lines to be added after deletion are what is already there!
Code:user@RT-AC86U-4608:/tmp/home/root# cat /jffs/configs/profile.add alias nsru='cd /tmp/mnt/WD1tb/nsru' alias nsrum='sh /jffs/scripts/nsrum'
/usr/sbin/curl --retry 3 "https://raw.githubusercontent.com/Xentrk/Asuswrt-Merlin-Linux-Shell-Scripts/master/profile.add" -o "/jffs/configs/profile.add"
/usr/sbin/curl --retry 3 "https://raw.githubusercontent.com/Xentrk/nvram-save-restore-utility/master/nsrum" -o "/jffs/scripts/nsrum" && sleep 5 && chmod 755 /jffs/scripts/nsrum && sh /jffs/scripts/nsrum
#help
Command List:
Chk_ADNS List OpenVPN DNS Settings
clients List hostname, IP address and MAC address for LAN clients
js cd /jffs/scripts
jc cd /jffs/configs
ld cd /opt/var/log
liststats List number of entries in each IPSET list
listiface List status of WAN and OpenVPN interfaces
MatchIP Check IP against IPSET lists to see if the IP address exists
Usage: MactchIP 111.222.333.444
purge_routes Purge policy routing rules
routes Alternative to 'ip routes' command
tree Similar to the Unix 'tree' command to list directories
ltree List directories and files in each directory
Ah. Okay. I don't have an answer at the moment then. Have you ever had aliases work in /jffs/configs/profile.add before?
If you don't have too many entries in /jffs/configs/profile.add
user@RT-AC86U-4608:/tmp/home/root# cat /jffs/configs/profile.add
alias nsru='cd /tmp/mnt/WD1tb/nsru'
alias nsrum='sh /jffs/scripts/nsrum'
Thanks for the reference to the dhcpstaticlist.sh script. I knew something like that existed (from casual reading of SNB Merlin forum), but didn't remember the name or any details.You can use the dhcpstaticlist.sh script to convert dhcp static leases from being stored in nvram to dnsmasq.conf.add to free up additional nvram space.
The only other thing I can think of is to try a different SSH client. I use MobaXterm.I believe so, but I have never dug this deeply into that file. I had the same AMTM issues that others had on update earlier this week, and run the "unalias amtm" to resolve that as posted here.
The cat /jffs/configs/profile.add is complete here.
Code:user@RT-AC86U-4608:/tmp/home/root# cat /jffs/configs/profile.add alias nsru='cd /tmp/mnt/WD1tb/nsru' alias nsrum='sh /jffs/scripts/nsrum'
I will delete the nsrum installation and try those suggestions above later today when I have time. Thank you.

Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!