1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lidarr_ynh.git synced 2024-09-03 19:35:58 +02:00
lidarr_ynh/scripts/change_url

48 lines
1.9 KiB
Bash
Executable file

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression "Stopping $app's systemd service..."
ynh_systemctl --service=$app --action="stop" --log_path="systemd"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression "Updating NGINX web server configuration..."
ynh_config_change_url_nginx
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# UPDATE CONFIGURATION FILE
#=================================================
# Add newline at end of file if required
if [ -e "$data_dir/config.xml" ]; then
sed -i -e '$a\' "$data_dir/config.xml"
fi
ynh_config_add --template="config.xml" --destination="$data_dir/config.xml"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$data_dir/config.xml"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod o-rwx "$data_dir/config.xml"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app "$data_dir/config.xml"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
ynh_systemctl --service=$app --action="start" --log_path="systemd" --wait_until="Application started"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Change of URL completed for $app"