1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jellyfin_ynh.git synced 2024-09-03 19:26:29 +02:00
jellyfin_ynh/scripts/change_url
eric_G 6a3fa81973
Testing (#143)
* Manifestv2

* add back user and install_dir to manifest

* Update manifest.toml

* rewrite update_version.sh in python for toml

* Bump jellyfin-ffmpeg to 6.0-6 as #136 (Thanks @Tagadda)

* Only add user to render group if not already

* Remove line_match from ynh_systemd_actions : they actually just match when systemctl returns

* Fix upgrade: uninstall previous packages

* Installation of deb packages will overwrite the configuration files, so to prevent a warning we backup those files beforehand.

* Test with a long sleep

* Auto-update README

* update_version: fix linter

* Add ldap to update_version.py

* Revert sleep 30 from debugging

* Do not remove packages during upgrade

* Fix upgrade again

---------

Co-authored-by: Félix Piédallu <felix@piedallu.me>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
2024-02-03 18:51:16 +01:00

58 lines
2.1 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=2
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --timeout=15
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
ynh_change_url_nginx_config
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# BASE URL
#=================================================
# Change the path in system.xml config file
if [ $change_path -eq 1 ]
then
# If somehow <BaseUrl /> was not replaced during install
if grep -q "<BaseUrl />" "$config_path/network.xml"; then
ynh_replace_string --match_string="<BaseUrl />" --replace_string="<BaseUrl>$new_path</BaseUrl>" --target_file="$config_path/network.xml"
else
ynh_replace_string --match_string="<BaseUrl>$old_path</BaseUrl>" --replace_string="<BaseUrl>$new_path</BaseUrl>" --target_file="$config_path/network.xml"
fi
fi
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=2
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --timeout=15
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last