1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 08:16:07 +00:00

generate_seafevents_conf (#5618)

This commit is contained in:
欢乐马
2023-08-29 17:31:46 +08:00
committed by GitHub
parent 77e7ded7df
commit 0b9d2bc39d

View File

@@ -189,6 +189,19 @@ function move_old_customdir_outside() {
}
function generate_seafevents_conf() {
if [[ ! -e "${SEAFILE_CENTRAL_CONF_DIR}/seafevents.conf" ]]; then
DB_HOST=`awk -F '=' '/\[database\]/{a=1}a==1&&$1~/^host/{print $2;exit}' ${SEAFILE_CENTRAL_CONF_DIR}/seafile.conf`
DB_PORT=`awk -F '=' '/\[database\]/{a=1}a==1&&$1~/^port/{print $2;exit}' ${SEAFILE_CENTRAL_CONF_DIR}/seafile.conf`
DB_USER=`awk -F '=' '/\[database\]/{a=1}a==1&&$1~/^user/{print $2;exit}' ${SEAFILE_CENTRAL_CONF_DIR}/seafile.conf`
DB_PASSWORD=`awk -F '=' '/\[database\]/{a=1}a==1&&$1~/^password/{print $2;exit}' ${SEAFILE_CENTRAL_CONF_DIR}/seafile.conf`
DB_NAME="seahub_db"
PRO_PY=${INSTALLPATH}/pro/pro.py
$PYTHON ${PRO_PY} setup --mysql --mysql_host ${DB_HOST} --mysql_port ${DB_PORT} --mysql_user ${DB_USER} --mysql_password ${DB_PASSWORD} --mysql_db ${DB_NAME}
fi
}
#################
# The main execution flow of the script
@@ -205,6 +218,8 @@ move_old_customdir_outside;
make_media_custom_symlink;
upgrade_seafile_server_latest_symlink;
generate_seafevents_conf;
echo
echo "-----------------------------------------------------------------"