1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/piped_ynh.git synced 2024-09-03 20:05:54 +02:00
piped_ynh/scripts/change_url
2024-06-02 23:15:45 +02:00

48 lines
No EOL
1.7 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app-api --action="stop" --log_path="/var/log/$app/$app-api.log"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..."
ynh_change_url_nginx_config
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
ynh_script_progression --message="Updating $app configuration..."
sed -i s/"$old_domain"/"$new_domain"/g $install_dir/dist/assets/*
ynh_add_config --template="config.properties" --destination="$install_dir/config.properties"
chown $app:$app "$install_dir/config.properties"
chmod 600 "$install_dir/config.properties"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app-api --action="start" --log_path="/var/log/$app/$app-api.log" --line_match="Database connection is ready!"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last