Checking where is located the shm directory

Hi, in raspiand shm is located under /run, i added this check in order to run this on raspbian wheeze