Looks to me like you could use calibre-portable.sh to do what you need in setting the variables and changing the line"
Code:
$CALIBRE --with-library "${CALIBRE_LIBRARY_DIRECTORY}"
to
Code:
$CALIBRE-SERVER --with-library "${CALIBRE_LIBRARY_DIRECTORY}"
You have it working that all that matters.
bernie