1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

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!

User NVRAM Save/Restore Utility (R26.2)

Discussion in 'Asuswrt-Merlin' started by john9527, Sep 15, 2014.

  1. Eet_46

    Eet_46 Occasional Visitor

    Joined:
    Dec 10, 2014
    Messages:
    44
    Running the command shows me a couple af "astrill_xxxx" entries, so it could seem they are easy to find.. Is there a command to "extract" all the astrill entries from nvram? Sorry, i'm not that familiar with linux command line :)
     
  2. john9527

    john9527 Part of the Furniture

    Joined:
    Mar 28, 2014
    Messages:
    6,096
    Location:
    United States
    There sure is....

    nvram show | grep astrill_

    and copy/paste the data
     
  3. Eet_46

    Eet_46 Occasional Visitor

    Joined:
    Dec 10, 2014
    Messages:
    44
    Ok, here goes..

    I'm guessing something like this could be added to the nvram.ini:

    [Astrill VPN settings]
    astrill_vpnmode
    astrill_mssfix
    astrill_iflist
    astrill_protocol
    astrill_key
    astrill_mode
    astrill_accel
    astrill_blockinternet
    astrill_update
    astrill_devices
    astrill_servers_dedi
    astrill_sid
    astrill_exflt
    astrill_dmzdevice
    astrill_ifmode
    astrill_update_lastcheck
    astrill_port
    astrill_ifexlist
    astrill_autostart
    astrill_serial
    astrill_devmode
    astrill_iplist
    astrill_serverid
    astrill_iplistraw
    astrill_cipher
    astrill_ip
    astrill_portindex
    astrill_dnsserver


    There's an astrill_bootstrap entry too, but it contains like a mini-script, with all kinds of characters and i figure it could be left out. I'm thinking i would need to re-install the applet anyway after a firmware upgrade, then this entry will be created anyway?
     
    Last edited: Jan 12, 2015
  4. john9527

    john9527 Part of the Furniture

    Joined:
    Mar 28, 2014
    Messages:
    6,096
    Location:
    United States
    That looks good (I'm still amazed that Astrill had the discipline to name the nvram entries with a common identifier like that).

    One thing that I think you'll need to test is when to do the restore. Installing the applet may set all the values to some default. So we need to determine the sequence

    FW upgrade -> factory reset -> nvram restore -> install astrill

    or

    FW upgrade -> factory reset -> install astrill - nvram restore

    I suspect the second case will work better, and then I would include the astrill_bootstrap entry.
     
  5. tsunami2311

    tsunami2311 Senior Member

    Joined:
    Apr 25, 2013
    Messages:
    454
    Update on this it was indeed a bug in x64 builds of firefox that was keeping MS onedrive from showing up correctly/ 35.xx build have fixed this.

    Just thought i mentionin case anyone else has the issue, make sure you update to 35.xx builds for x64 firefox builds
     
  6. john9527

    john9527 Part of the Furniture

    Joined:
    Mar 28, 2014
    Messages:
    6,096
    Location:
    United States
    Version 10 Update

    First update of the new year...

    Version 10 18-January-2015
    - add versioned backup of /jffs directory if found
    - new script jffs-restore.sh to restore the jffs backup
    - updated QuickStart guide for jffs backup (please read)
    - added section for Astrill VPN - thanks Eet_46
    - updated file headers to reflect actual release numbering

    While browsing through the forum, I found someone asking about how to back up his custom jffs scripts. Now, if the utility finds a jffs directory, a backup directory will be created on the USB stick 'jffs-yyyymmdd-macid'. A new script has also been added, jffs-restore.sh, which will delete the current contents of your jffs directory and replace it with a backup from the USB stick. Of course, you can also just pick and choose files to restore with normal linux commands.

    Enjoy!
     
  7. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    31,174
    Location:
    Canada
    John, if you want to future-proof yourself, you might want to add the new nvram settings I'm adding with 378.50.

    Code:
    vpn_serverx_start - this will replace vpn_serverx_eas, as Asus isn't using it the same way I was, causing conflicts.  Same syntax as the _eas setting.
    jffs2_scripts - this will enable or disable the execution of user scripts and custom configuration.  Default will be 0.
    
     
  8. jimf

    jimf Occasional Visitor

    Joined:
    Nov 17, 2013
    Messages:
    27
    Merlin,

    Would you consider writing a GUI version of this at some point? Would make it easier for those of us who rarely do this to remember how it's done. Maybe put it on the admin backup/restore screen and just download the result the same way the existing backup works -- this would be better for security as it keeps the backup away from the router. This is a great utility but I'll probably forget how to use it next week :).
     
  9. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    31,174
    Location:
    Canada
    I'm not opposed to the idea, but it's not something I have time to look into in the near future.
     
  10. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    9,702
    This would be most excellent when you do have the time to implement.

    Would really push Asus into another league from the rest of the consumer routers.

    Of course, Asus would pick this up quickly and the long term support wouldn't be needed too. ;)
     
  11. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    31,174
    Location:
    Canada
    The problem is that this script is far from being bulletproof. Asus could at any time change the structure of one of the settings this script thinks safe, making saved settings unusable on a newer firmware. Or, a bug like the recent corruption of the wl_nband setting require either a factory default reset, or manually correcting the value over SSH/telnet. For the average joe, the factory default reset is the only workable solution.

    The only way to really address all those issues would be to switch the configuration to a scheme where each field can have a version attached to it. That way, any field that has a version that's too old could be automatically replaced with a default value, and the enduser notified somehow of this occurring. That kind of implementation is quite complex however.

    That's one of the things that make me pause before considering adding this to the firmware. It does work - in _most_ situation. The problem is having to explain to the user how, at some point, it might be as undesirable as the standard settings backup feature, at which point we're back to square one.
     
  12. elorimer

    elorimer Very Senior Member

    Joined:
    Dec 16, 2013
    Messages:
    833
    A useful feature of the script is that the settings are in a text format, so it is an easy way of keeping track of your settings for re-entering them manually as well. perhaps the script could be adapted to just write a text file, leaving the script to read settings back in for enthusiasts.
     
  13. Trexx

    Trexx Regular Contributor

    Joined:
    Jan 12, 2015
    Messages:
    71
    Switching between different FW flavors

    John - Any feedback in regards to using your script across different ASUS fw flavors (stock asus, merlin, tomato, etc.)?

    Either save/load from say Tomato, or save from Tomato/reload into Merlin.

    Thanks for all your hard work,
    T.
     
  14. john9527

    john9527 Part of the Furniture

    Joined:
    Mar 28, 2014
    Messages:
    6,096
    Location:
    United States
    Definitely not a good idea (I put a warning note in the header in the files, next update I'll also add it to the QuickStart).

    While all the firmware has a common heritage, there has been sufficient differentiation over time (custom options, maybe changing the meaning of values for the same variable) that you'll either end up with a options set that you really didn't want or randomly missing options or end up filling up nvram with useless data.

    In my searches, I did find a similar utility had been written for DD-WRT, but nothing for Tomato that I found except for a couple of forum posts.
     
  15. cyborgpunte

    cyborgpunte Regular Contributor

    Joined:
    Feb 14, 2014
    Messages:
    138
  16. john9527

    john9527 Part of the Furniture

    Joined:
    Mar 28, 2014
    Messages:
    6,096
    Location:
    United States
    Not missing....they are included in the nvram.ini file :D

    wl0_txbf
    wl1_txbf
    wl0_itxbf
    wl1_itxbf
     
  17. Alaska99

    Alaska99 Occasional Visitor

    Joined:
    Jan 26, 2013
    Messages:
    20
    Is it safe to use this script and restore settings after an upgrade to 378.50 beta 1 on my RT-AC68U ?
    Someone try it?
    Thank you :)
     
    Last edited: Jan 25, 2015
  18. JGrana

    JGrana Senior Member

    Joined:
    May 31, 2013
    Messages:
    214
    I did try it. Seems to be working fine. Since this app uses common variables/settings (no hidden items), I figured it was safe.

    I did the save/restore on an RT-AC87U. So far so good.

    I also have ab RT-AC68. I am about to save/flash/erase nvram/restore. I will let you know how it goes.

    I do suspect some new variables will need to be added to the nvram.ini.

    Also, it appears that all of my scripts and files in /jffs were gone. I had a backup and have just restored them.

    Be warned, backup /jffs/* before installing the new version.
     
    Last edited: Jan 25, 2015
  19. john9527

    john9527 Part of the Furniture

    Joined:
    Mar 28, 2014
    Messages:
    6,096
    Location:
    United States
    Glad to hear it appears to be working.....it should be fine. Worst case if you did have a problem, you could do a factory reset, and by printing out the restore script you would have a copy of all your settings to input.

    Also, note if you have the latest version of the utility, you'll also have a copy of your /jffs directory on the USB stick ready to restore (in the /jffs-yyyymmdd-macid directory).

    Finally, yes there will need to be an update to support the 378 code (Merlin already gave a hint earlier)....but that will be when moving from 378 to save the new vars.
     
  20. tsunami2311

    tsunami2311 Senior Member

    Joined:
    Apr 25, 2013
    Messages:
    454
    I read the update right? does this now back up the custom scripts/cron job? aka a weekly reboot script?