mirror of
https://github.com/YunoHost-Apps/kavita_ynh.git
synced 2024-09-03 19:26:30 +02:00
59 lines
2.1 KiB
Bash
59 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=1
|
|
|
|
ynh_systemd_action --service_name="$app" --action=stop --log_path=systemd
|
|
|
|
#=================================================
|
|
# MODIFY URL IN NGINX CONF
|
|
#=================================================
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
ynh_change_url_nginx_config
|
|
|
|
#=================================================
|
|
# SPECIFIC MODIFICATIONS
|
|
#=================================================
|
|
# CONFIGURE Kavita
|
|
#=================================================
|
|
ynh_backup_if_checksum_is_different --file="$install_dir/config/appsettings.json"
|
|
|
|
key=$(ynh_app_setting_get --app="$app" --key=key)
|
|
domain="$new_domain"
|
|
ynh_app_setting_set --app="$app" --key=domain --value="$domain"
|
|
url_path=${new_path#/}
|
|
ynh_app_setting_set --app="$app" --key=url_path --value="$url_path"
|
|
|
|
ynh_add_config --template="../conf/appsettings.json.example" --destination="$install_dir/config/appsettings.json"
|
|
|
|
chmod 400 "$install_dir/config/appsettings.json"
|
|
chown "$app":"$app" "$install_dir/config/appsettings.json"
|
|
|
|
#=================================================
|
|
# GENERIC FINALISATION
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
|
|
# Start a systemd service
|
|
ynh_systemd_action --service_name="$app" --action=start --log_path=systemd
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|