Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Getting port mappings and DHCP usage from an Airport Device' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Getting port mappings and DHCP usage from an Airport Device
Authored by: alexiskai on Dec 30, '11 08:08:15AM
Per the comments, here's an improvement.

1. Download the script to your desktop and save it as something.sh, e.g. exportairport.sh
2. In Terminal, navigate to the desktop and run chmod u+x exportairport.sh
3. Now open the script in Terminal, i.e. vi exportairport.sh
4. After the first block of comments, ending with:
# $Revision: 1.12 $
#
###############################################################################
insert the following code (you can change airport.xls to whatever.xls if you like):
LOGFILE=airport.xls

exec 6>&1           # Link file descriptor #6 with stdout.
                    # Saves stdout.

exec > $LOGFILE
5. Now go down to the last line of the script; after the last line, insert the following code:
exec 1>&6 6>&-      # Restore stdout and close file descriptor #6.

exit 0
6. Save and exit.

One more tip is that you should save your Airport .baseconfig file with no spaces in the name. This script translates spaces to carriage returns and it looks awkward.

So now you can run ./exportairport.sh aebs.baseconfig and it will simply output airport.xls, which you can then double-click and open in Excel.

Edit: I opted not to have the script actually open Excel itself for several reasons, mostly that you might simply wish to retrieve the file over SFTP/AFP or you might not have Excel on the box in question, e.g. a file server.
Edited on Dec 30, '11 08:26:45AM by alexiskai


[ Reply to This | # ]