bash version of c_rehash script from OpenSSL
