All the credit for the code belongs to others including https://gist.github.com/albertbori/1798d88a93175b9da00b
Assuming you have git all ready configured for GitHub, then simply do the following
git clone https://github.com/paulbhart/toggleairport.git
cd toggleairport
sudo ./install.sh
to uninstall just do
sudo ./uninstall.sh