Shell Script to Forward iTunes Library to Remote Machine via SSH
Note: I originally posted this on Forrst.
I like to keep my music collection fairly centralized. Instead of having my music files spread out amongst various home and work computers, I have a machine at home host my iTunes/DAAP music library via forked-daapd (although one could just as easily leave a computer running iTunes open).
This shell script, tested on OS X 10.6, connects to my home machine via SSH and forwards the DAAP port to my remote machine. There are a few blog posts out there that describe how to do this, but this is the script I eventually landed on. If you have any suggestions for improvements, please let me know.
You’ll need to be able to log into your home machine via SSH. To connect outside your own LAN, you’ll also need to configure your router at home to forward the SSH port (default: 22) to whatever machine is hosting your iTunes library.
Here’s the shell script: