start-firefox 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. basedir=$(dirname "$0")
  3. add_LD_LIBRARY_PATH() {
  4. if test -z "$LD_LIBRARY_PATH"
  5. then
  6. LD_LIBRARY_PATH="$1"
  7. else
  8. LD_LIBRARY_PATH="$1:$LD_LIBRARY_PATH"
  9. fi
  10. }
  11. # Bug 27552: On CentOS/RHEL 6, we need to add the firefox bundled dir
  12. # to LD_LIBRARY_PATH
  13. if test -f /etc/system-release-cpe
  14. then
  15. if test "$(cut -d : -f 3 /etc/system-release-cpe)" = centos || \
  16. test "$(cut -d : -f 3 /etc/system-release-cpe)" = "enterprise_linux"
  17. then
  18. if test "$(cut -d : -f 5 /etc/system-release-cpe)" = "6"
  19. then
  20. if test -d /usr/lib64/firefox/bundled/lib64
  21. then
  22. add_LD_LIBRARY_PATH /usr/lib64/firefox/bundled/lib64
  23. elif test -d /usr/lib/firefox/bundled/lib
  24. then
  25. add_LD_LIBRARY_PATH /usr/lib/firefox/bundled/lib
  26. else
  27. echo "Error: the firefox package (version 60 or more) is not installed." >&2
  28. echo "On CentOS/RHEL 6, Tor Browser requires the firefox package to be installed." >&2
  29. exit 1
  30. fi
  31. fi
  32. fi
  33. fi
  34. # Check if the system has a more recent version of libstdc++.so.6; if yes, use
  35. # that instead of the bundled version.
  36. "$basedir/abicheck" >/dev/null 2>&1
  37. if [ $? -ne 0 ]; then
  38. add_LD_LIBRARY_PATH "$basedir/TorBrowser/Tor/libstdc++/"
  39. fi
  40. add_LD_LIBRARY_PATH "$basedir/TorBrowser/Tor/"
  41. export LD_LIBRARY_PATH
  42. exec "$basedir/firefox.real" "$@"