-
Notifications
You must be signed in to change notification settings - Fork 1
/
group.sh
executable file
·50 lines (40 loc) · 1.59 KB
/
group.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
50
#!/bin/bash
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "${SCRIPT}")
TOPDIR=$(dirname "${SCRIPTPATH}")
INSTALLPATH=${TOPDIR}/seafile-server-latest
default_ccnet_conf_dir=${TOPDIR}/ccnet
default_seafile_data_dir=${TOPDIR}/seafile-data
default_conf_dir=${TOPDIR}/conf
pyscript=${SCRIPTPATH}/$(basename ${0%.sh}.py)
function check_python_executable() {
if [[ "$PYTHON" != "" && -x $PYTHON ]]; then
return 0
fi
if which python2.7 2>/dev/null 1>&2; then
PYTHON=python2.7
elif which python27 2>/dev/null 1>&2; then
PYTHON=python27
elif which python2.6 2>/dev/null 1>&2; then
PYTHON=python2.6
elif which python26 2>/dev/null 1>&2; then
PYTHON=python26
else
echo
echo "Can't find a python executable of version 2.6 or above in PATH"
echo "Install python 2.6+ before continue."
echo "Or if you installed it in a non-standard PATH, set the PYTHON enviroment varirable to it"
echo
exit 1
fi
}
check_python_executable;
# running script
export CCNET_CONF_DIR=${default_ccnet_conf_dir}
export SEAFILE_CONF_DIR=${default_seafile_data_dir}
export SEAFILE_CENTRAL_CONF_DIR=${default_conf_dir}
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python2.6/site-packages:${INSTALLPATH}/seafile/lib64/python2.6/site-packages:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python2.7/site-packages:${INSTALLPATH}/seafile/lib64/python2.7/site-packages:$PYTHONPATH
export PYTHONPATH=${INSTALLPATH}/seahub:$PYTHONPATH
export DJANGO_SETTINGS_MODULE=seahub.settings
$PYTHON ${pyscript} $@