check_install.sh 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/bin/sh
  2. # Checks certain parts of an AssaultCube installation
  3. #
  4. # Try this, if your game does not start.
  5. #
  6. CUBE_DIR=$(dirname "$(readlink -f "${0}")")
  7. cd "$CUBE_DIR"
  8. # check libs
  9. SERVERLIBS="libz"
  10. CLIENTLIBS="libSDL-1.2 libz libX11 libSDL_image libogg libvorbis libopenal"
  11. if [ -x "/sbin/ldconfig" ]; then
  12. echo "checking libraries:"
  13. for libname in $SERVERLIBS; do
  14. if [ -z "$(/sbin/ldconfig -p | grep $libname)" ]; then
  15. echo " library $libname not found - this lib is required for server and client installations"
  16. else
  17. echo " found $libname"
  18. fi
  19. done
  20. for libname in $CLIENTLIBS; do
  21. if [ -z "$(/sbin/ldconfig -p | grep $libname)" ]; then
  22. echo " library $libname not found - this lib is required for client installations only"
  23. else
  24. echo " found $libname"
  25. fi
  26. done
  27. else
  28. echo "skipping libraries check: couldn't find /sbin/ldconfig"
  29. echo " to run a server, you'll need:" $SERVERLIBS
  30. echo " to run a client, you'll need:" $SERVERLIBS $CLIENTLIBS
  31. fi
  32. echo ""
  33. # check all files that belong to the installation
  34. # (use source/dev_tools/generate_md5_checksums.sh to generate a checksum file)
  35. CHKSUMFILE="packages/misc/checksums_md5.txt"
  36. if [ -e $CHKSUMFILE ]; then
  37. echo "checking installed game files:"
  38. if md5sum -c $CHKSUMFILE --status; then
  39. echo " all files of the AC package are checked and OK"
  40. else
  41. echo " some files of your AC installation appear to be missing or damaged"
  42. read -p " press enter, to see the list of files..." -r dummy
  43. md5sum -c $CHKSUMFILE --quiet | less
  44. fi
  45. else
  46. echo "skipping file check: couldn't find $CHKSUMFILE"
  47. fi
  48. echo ""
  49. # list existing desktop launcher items
  50. LAUNCHERPATH="${HOME}/.local/share/applications/"
  51. EXISTINGEXEC=`find "${LAUNCHERPATH}" -name "assaultcube*" | xargs`
  52. if [ "$EXISTINGEXEC" != "" ]; then
  53. echo "the following menuitem(s) wer found:"
  54. echo " $EXISTINGEXEC"
  55. else
  56. echo "no desktop launcher items were found - run install_or_remove_menuitem.sh to create one"
  57. fi
  58. echo ""
  59. # find out, which binaries would be used to start the game
  60. echo "checking game executables:"
  61. SERVERBIN=`./server.sh --outputbinarypath`
  62. CLIENTBIN=`./assaultcube.sh --outputbinarypath`
  63. if [ -x "$SERVERBIN" ]; then
  64. echo " the server will use the binary $SERVERBIN"
  65. elif [ -e "$SERVERBIN" ]; then
  66. echo " the server would use the binary $SERVERBIN, if the permissions would allow it"
  67. else
  68. echo " the server would use the binary $SERVERBIN, but the file does not exist"
  69. fi
  70. if [ -x "$CLIENTBIN" ]; then
  71. echo " the game client will use the binary $CLIENTBIN"
  72. elif [ -e "$CLIENTBIN" ]; then
  73. echo " the server would use the binary $CLIENTBIN, if the permissions would allow it"
  74. else
  75. echo " the server would use the binary $CLIENTBIN, but the file does not exist"
  76. fi
  77. exit 0