forked from Tribler/tribler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tribler.sh
executable file
·49 lines (36 loc) · 1.04 KB
/
tribler.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# Run Tribler from source tree
UNAME=$(uname -s)
if [ -z "$PROFILE_TRIBLER" ]; then
TRIBLER_SCRIPT=Tribler/Main/tribler.py
else
TRIBLER_SCRIPT=Tribler/Main/tribler_profiler.py
fi
if [ $UNAME == "Linux" ]; then
# Find the Tribler dir
TRIBLER_DIR=$( dirname $(readlink -f "$0"))
if [ ! -d "$TRIBLER_DIR" ]; then
TRIBLER_DIR=$( dirname $(readlink -f $(which "$0")))
fi
if [ ! -d "$TRIBLER_DIR" ]; then
echo "Couldn't figure out where Tribler is, bailing out."
exit 1
fi
cd $TRIBLER_DIR
PYTHONPATH=.:"$PYTHONPATH"
export PYTHONPATH
python $TRIBLER_SCRIPT
else
if [ $UNAME == "Darwin" ]; then
if [ ! -e $TRIBLER_SCRIPT ]; then
echo "ERROR: Script must be called from source tree root"
echo " Try the following commands:"
echo "cd $(dirname $0)"
echo "./$(basename $0)"
exit 1
fi
PYTHONVER=2.7
PYTHON="arch -i386 /usr/bin/python$PYTHONVER"
$PYTHON $TRIBLER_SCRIPT
fi
fi