Working on Fedora 19. Forked script from http://code.google.com/p/napi-bash/