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