Introduction: Script to Backup Linksys Wireless Access Point Configurations

About: 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 and let me know how it goes. cheers, -Joe

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