1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/collabora_ynh.git synced 2024-09-03 18:16:25 +02:00
This commit is contained in:
ericgaspar 2021-06-26 09:23:07 +02:00
parent 4d596d4b7e
commit 3d7ce637f3
5 changed files with 53 additions and 3 deletions

View file

@ -40,6 +40,12 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup --src_path="/usr/lib/systemd/system/loolwsd.service"
#=================================================
# SPECIFIC BACKUP
#=================================================

View file

@ -91,6 +91,13 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=3
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Collabora online office suite" --log="/var/log/$app/$app.log"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -19,6 +19,25 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port)
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null
then
ynh_script_progression --message="Removing $app service integration..." --weight=1
yunohost service remove $app
fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
# Remove the dedicated systemd config
ynh_remove_systemd_config --service="loolwsd"
#=================================================
# STANDARD REMOVE
#=================================================

View file

@ -56,6 +56,14 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=10
DEBIAN_VERSION_NUMBER=$(cat /etc/debian_version | head -n 1 | cut -f1 -d .)
ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos/CollaboraOnline/CODE-debian${DEBIAN_VERSION_NUMBER} ./ " --package="$pkg_dependencies" --key="https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C54D189F4BA284D"
#=================================================
# RESTORE SYSTEMD
#=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
ynh_restore_file --origin_path="/usr/lib/systemd/system/loolwsd.service"
systemctl enable $app.service --quiet
#=================================================
# RESTORE CONFIGURATION
#=================================================
@ -63,6 +71,13 @@ ynh_script_progression --message="Restoring the configuration..." --weight=3
ynh_restore_file --origin_path="/etc/loolwsd/loolwsd.xml"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Collabora online office suite" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
@ -70,8 +85,6 @@ ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX
#=================================================

View file

@ -88,7 +88,12 @@ ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos
ynh_add_config --template="../conf/loolwsd.xml" --destination="/etc/loolwsd/loolwsd.xml"
#=================================================
# GENERIC FINALIZATION
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Collabora online office suite" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================