Perfect, thanks!
I added the following to bitcoin.conf:
walletnotify=/foo/walletnotify.sh %s
And walletnotify.sh simply wgets to localhost. The shell script works when calling it on the Mac Os X terminal. I've given the script file full permissions to all groups. However, Bitcoind gives the following error when issuing a notify:
runCommand error: system(/foo/walletnotify.sh 5d8fb8dbd106f862cbf80be514e0ea2ad7b4136cbd1c3b91299e5325687529ba) returned 32512
I found the place where this call is made
https://github.com/bitcoin/bitcoin/blob/f76c122e2eac8ef66f69d142231bd33c88a24c50/src/wallet.cpp#L497, but wasn't able to find what is happening inside the t() method.
Any ideas as to why this isn't working?
EDIT: I'm using Bitcoin-Qt 0.8.5-beta
EDIT 2:
http://stackoverflow.com/questions/5638321/why-child-process-returns-exit-status-32512-in-unix gave an idea to try
walletnotify=sh -c '/foo/walletnotify.sh %s' but to no avail.
EDIT 3: Ah, here it is
https://github.com/bitcoin/bitcoin/blob/16d5f2c5e0a7276fb2b09d8dd51b7bac2753c4cc/src/util.cpp#L1490 and it indeed seems to be using system().
EDIT 4 (SOLVED): Apparently the call isn't executed in a shell env, and so the wget inside the .sh needs to be called with an abs path.