From 65f9bf5dfbb0734a8ad528e6ba4288629c255f3b Mon Sep 17 00:00:00 2001 From: RandumKiwi Date: Sat, 2 Nov 2013 23:16:10 +0000 Subject: [PATCH] Shell file checks for required libraries and warns if not installed. Please revert if it's not helpful -- RK. git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7627 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- assaultcube.sh | 2 +- server.sh | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/assaultcube.sh b/assaultcube.sh index 759fdbab..30e73143 100755 --- a/assaultcube.sh +++ b/assaultcube.sh @@ -75,7 +75,7 @@ if [ -x "/sbin/ldconfig" ]; then echo "To run AssaultCube, please ensure vorbis libraries are installed." exit 1 fi - if [ -z "$(/sbin/ldconfig -p | grep "libopepnal")" ]; then + if [ -z "$(/sbin/ldconfig -p | grep "libopenal")" ]; then echo "To run AssaultCube, please ensure OpenAL-Soft libraries are installed." exit 1 fi diff --git a/server.sh b/server.sh index 54e547a9..4392a89f 100755 --- a/server.sh +++ b/server.sh @@ -50,10 +50,27 @@ then MACHINE_NAME= fi -if [ -x "${CUBE_DIR}/bin_unix/${SYSTEM_NAME}${MACHINE_NAME}server" ] -then +if [ -x "/sbin/ldconfig" ]; then + if [ -z "$(/sbin/ldconfig -p | grep "libSDL-1.2")" ]; then + echo "To run AssaultCube, please ensure SDL v1.2 libraries are installed." + exit 1 + fi + if [ -z "$(/sbin/ldconfig -p | grep "libz")" ]; then + echo "To run AssaultCube, please ensure z libraries are installed." + exit 1 + fi + if [ -z "$(/sbin/ldconfig -p | grep "libcurl")" ]; then + echo "To run AssaultCube, please ensure Curl libraries are installed." + exit 1 + fi +fi + +if [ -x "${CUBE_DIR}/bin_unix/${SYSTEM_NAME}${MACHINE_NAME}server" ]; then cd "${CUBE_DIR}" exec "${CUBE_DIR}/bin_unix/${SYSTEM_NAME}${MACHINE_NAME}server" "${CUBE_OPTIONS}" "${CUBE_OPTIONFILE}" "$@" +elif [ -e "${CUBE_DIR}/bin_unix/${SYSTEM_NAME}${MACHINE_NAME}server" ] + echo "Insufficient permissons to run AssaultCube." + echo "Please change (chmod) the AssaultCube server in the bin_unix folder to be readable/executable." else echo "Your platform does not have a pre-compiled AssaultCube server." echo "Please follow the following steps to build a native client:"