diff --git a/scripts/seaf-gc.sh b/scripts/seaf-gc.sh index bb97605f32..46540fecac 100755 --- a/scripts/seaf-gc.sh +++ b/scripts/seaf-gc.sh @@ -11,6 +11,8 @@ default_conf_dir=${TOPDIR}/conf check_db_py=${INSTALLPATH}/check-db-type.py seaf_gc=${INSTALLPATH}/seafile/bin/seafserv-gc seaf_gc_opts="" +pro_pylibs_dir=${INSTALLPATH}/pro/python +IS_PRO_SEAFEVENTS=`awk '/is_pro/{getline;print $2;exit}' ${pro_pylibs_dir}/seafevents/seafevents_api.py` export PATH=${INSTALLPATH}/seafile/bin:$PATH export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH} @@ -18,7 +20,7 @@ export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafil script_name=$0 function usage () { echo "usage : " - if [[ -d ${INSTALLPATH}/pro ]]; then + if [[ $IS_PRO_SEAFEVENTS = "True" ]]; then echo "$(basename ${script_name}) [--dry-run | -D] [--rm-deleted | -r] [--rm-fs | -R] [repo-id1] [repo-id2]" else echo "$(basename ${script_name}) [--dry-run | -D] [--rm-deleted | -r] [repo-id1] [repo-id2]" @@ -88,7 +90,7 @@ function validate_already_running () { function run_seaf_gc () { - if [[ -d ${INSTALLPATH}/pro ]]; then + if [[ $IS_PRO_SEAFEVENTS = "True" ]]; then seafile_conf=${default_conf_dir}/seafile.conf db_type=$($PYTHON $check_db_py $seafile_conf) diff --git a/scripts/seafile.sh b/scripts/seafile.sh index cdabfc250b..5771d49161 100755 --- a/scripts/seafile.sh +++ b/scripts/seafile.sh @@ -21,6 +21,7 @@ central_config_dir=${TOPDIR}/conf seaf_controller="${INSTALLPATH}/seafile/bin/seafile-controller" pro_pylibs_dir=${INSTALLPATH}/pro/python seafesdir=$pro_pylibs_dir/seafes +IS_PRO_SEAFEVENTS=`awk '/is_pro/{getline;print $2;exit}' ${pro_pylibs_dir}/seafevents/seafevents_api.py` export PATH=${INSTALLPATH}/seafile/bin:$PATH export ORIG_LD_LIBRARY_PATH=${LD_LIBRARY_PATH} @@ -113,7 +114,7 @@ function start_seafile_server () { validate_seafile_data_dir; validate_running_user; - if [[ -d ${INSTALLPATH}/pro ]]; then + if [[ $IS_PRO_SEAFEVENTS = "True" ]]; then test_config; fi @@ -121,7 +122,7 @@ function start_seafile_server () { mkdir -p $TOPDIR/logs - if [[ -d ${INSTALLPATH}/pro ]]; then + if [[ $IS_PRO_SEAFEVENTS = "True" ]]; then if ! LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH ${seaf_controller} -c "${default_ccnet_conf_dir}" -d "${default_seafile_data_dir}" -F "${central_config_dir}"; then controller_log="$default_seafile_data_dir/controller.log" echo diff --git a/scripts/seahub.sh b/scripts/seahub.sh index 84045e0862..de097414c2 100755 --- a/scripts/seahub.sh +++ b/scripts/seahub.sh @@ -29,6 +29,7 @@ gunicorn_exe=${INSTALLPATH}/seahub/thirdpart/bin/gunicorn pro_pylibs_dir=${INSTALLPATH}/pro/python seafesdir=$pro_pylibs_dir/seafes seahubdir=${INSTALLPATH}/seahub +IS_PRO_SEAFEVENTS=`awk '/is_pro/{getline;print $2;exit}' ${pro_pylibs_dir}/seafevents/seafevents_api.py` script_name=$0 function usage () { @@ -150,7 +151,7 @@ function before_start() { validate_seahub_running; prepare_seahub_log_dir; - if [[ -d ${INSTALLPATH}/pro ]]; then + if [[ $IS_PRO_SEAFEVENTS = "True" ]]; then if [[ -z "$LANG" ]]; then echo "LANG is not set in ENV, set to en_US.UTF-8" export LANG='en_US.UTF-8' diff --git a/scripts/setup-seafile.sh b/scripts/setup-seafile.sh index c241cc4cf9..4df5c9d8fb 100755 --- a/scripts/setup-seafile.sh +++ b/scripts/setup-seafile.sh @@ -9,6 +9,8 @@ default_seahub_db=${TOPDIR}/seahub.db default_conf_dir=${TOPDIR}/conf default_pids_dir=${TOPDIR}/pids default_logs_dir=${TOPDIR}/logs +pro_pylibs_dir=${INSTALLPATH}/pro/python +IS_PRO_SEAFEVENTS=`awk '/is_pro/{getline;print $2;exit}' ${pro_pylibs_dir}/seafevents/seafevents_api.py` export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH} @@ -16,7 +18,7 @@ server_manual_http='https://download.seafile.com/published/seafile-manual/home.m function welcome () { echo "-----------------------------------------------------------------" - if [[ -d ${INSTALLPATH}/pro ]]; then + if [[ $IS_PRO_SEAFEVENTS = "True" ]]; then echo "This script will guide you to config and setup your seafile professional server." else echo "This script will guide you to config and setup your seafile server."