#!/bin/sh
# update_codes.sh
#
# very simple script to update airport, phone and zip codes kept
# in /usr/share/misc from source data at the openbsd site.
base_url='http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/share/misc'
code_list='airport inter.phone na.phone zipcodes'
for code_type in $code_list; do
echo "downloading $code_type..."
src="$base_url/$code_type"
dest="/usr/share/misc/$code_type"
mv $dest ${dest}.bak
curl $src > $dest
done
As previously mentioned here, you may use the very cool Code Finder utility to view and search these files.
[robg adds: This script works as described, though you'll need to remember to make it executable (chmod 755 update_codes) and run it as root (sudo update_codes). Replace update_codes with whatever you named the script.]

