Docu

"readlink -f $0" is not compatible with Mac OS X and may result in a "rm -rf /" later on. This commit replaces it with a command which works fine on Linux and Mac OS X. Furthermore some error handling is added to ensure BASE_DIR, SODIUM_DIR and TOX_CORE_DIR are not unset or empty