Works on OS X

Added a simple check, so that script can work also on OS X (tested on 10.9)