mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
56 lines
1.8 KiB
Bash
56 lines
1.8 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
|
|
# Import common cmd
|
|
source ./experimental_helper.sh
|
|
source ./_common.sh
|
|
|
|
# Source YunoHost helpers
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# STANDARD MODIFICATIONS
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
ynh_change_url_nginx_config
|
|
|
|
#=================================================
|
|
# SPECIFIC MODIFICATIONS
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Stoping services..."
|
|
|
|
# Stop service before any change
|
|
ynh_systemd_action --service_name seafile --action stop
|
|
ynh_systemd_action --service_name seahub --action stop
|
|
sleep 2
|
|
pkill -f seafile-controller || true
|
|
pkill -f seaf-server || true
|
|
pkill -f ccnet-server || true
|
|
pkill -f seahub || true
|
|
|
|
ynh_script_progression --message="Updating seafile configuration..."
|
|
|
|
# Update Seafile Config
|
|
ynh_add_config --template=seahub_settings.py --destination=$install_dir/conf/seahub_settings.py
|
|
ynh_add_config --template=ccnet.conf --destination=$install_dir/conf/ccnet.conf
|
|
ynh_add_config --template=gunicorn.conf.py --destination=$install_dir/conf/gunicorn.conf.py
|
|
ynh_add_config --template=seafdav.conf --destination=$install_dir/conf/seafdav.conf
|
|
|
|
# Clean url in config in DB
|
|
clean_url_in_db_config
|
|
|
|
# Avoid the current effect
|
|
sleep 2
|
|
|
|
# Reload services
|
|
ynh_script_progression --message="Starting services..."
|
|
ynh_systemd_action --service_name seafile -l "spawned seaf-server, pid " -p /var/log/seafile/controller.log
|
|
ynh_systemd_action --service_name seahub -l "Started Seafile hub." -p "systemd"
|
|
sleep 2
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --time --last
|