loading
This instructable will show a script that can be used to automate the backup of linksys wireless access point configurations. Actually this can easily be edited to backup almost any linksys device.

Step 1: Requirements

I am going to assume you have a linux or os x system at your disposal. Although cygwin would work fine.

Step 2: Variables

Lets first set some variables. Edit all of these to match your environment.

#!/bin/bash
#Joe McManus
#backup linksys firewall

#set some variables
hostname=wrt54g.foo.bar.com
basedir=/data/network-backups
user=userame
pass=password
mailto=joe@foo.com

Step 3: Get Config

This bit uses wget to download the config and save as hostname-date.config.bin

#Get the config and save as hostname-date.config.bin
wget https://$hostname/Config.bin --user=$pass --password=$pass --no-check-certificate -O $basedir/$hostname-`date +%Y-%m-%d`.config.bin

Step 4: Check to See If It Worked

We now check to see if it worked, send email if not.

#check to see if it worked
if [$? != 0]
then
echo "Error: Backup failed"
mail -s"Error: Backup of $hostname failed at `date`" $mailto </dev/null
fi

Step 5: Put It All Together

Put it all together and run it. If it works add it to crontab. The full script is attached.
#Joe McManus
#backup linksys firewall

#set some variables
hostname=wrt54g.foo.bar.com
basedir=/data/network-backups
user=userame
pass=password
mailto=joe@foo.com

#Get the config and save as hostname-date.config.bin
wget https://$hostname/Config.bin --user=$pass --password=$pass --no-check-certificate -O $basedir/$hostname-`date +%Y-%m-%d`.config.bin

#check to see if it worked
if [$? != 0]
then
echo "Error: Backup failed"
mail -s"Error: Backup of $hostname failed at `date`" $mailto </dev/null
fi
<p>I don't use a LinkSys router, so it would be very helpful if you explained what your variables refer to, so this can be ported to other devices.</p><p> rp</p>

About This Instructable

4,063views

14favorites

License:

Bio: I like to tinker with just about anything, sometimes it works out in the end. Have fun looking at the projects, try tearing something open ... More »
More by joe:Intel Edison Garage Monitor and Alert System Intel Edison Fat Bike Tire Analyzer Intel Galileo Garage Monitor 
Add instructable to: