#!/bin/bash #================================================= # GENERIC START #================================================= # Source YunoHost helpers source /usr/share/yunohost/helpers # Stop script if errors ynh_abort_if_errors # Import common cmd source ./experimental_helper.sh source ./_common.sh # Retrive arguments path_url=$(ynh_normalize_url_path ${YNH_APP_NEW_PATH:-'/'}) old_domain=$YNH_APP_OLD_DOMAIN domain=$YNH_APP_NEW_DOMAIN port=$(ynh_app_setting_get "$app" http_port) nginx_status_port=$(ynh_app_setting_get "$app" nginx_status_port) dbuser=$app dbname=$app dbpass=$(ynh_app_setting_get "$app" mysqlpwd) #================================================= # STANDARD MODIFICATIONS #================================================= # Update nginx config if [ "$old_domain" != "$domain" ] then old_file_path="/etc/nginx/conf.d/$old_domain.d/$app.conf" new_file_path="/etc/nginx/conf.d/$domain.d/$app.conf" mv "$old_file_path" "$new_file_path" # Change the checksum setting name checksum_setting_old_name=checksum_${old_file_path//[\/ ]/_} checksum_setting_new_name=checksum_${new_file_path//[\/ ]/_} checksum_value=$(ynh_app_setting_get $app $checksum_setting_old_name) ynh_app_setting_set $app $checksum_setting_new_name $checksum_value fi config_nginx # Update monitorix configuration config_monitorix # Reload monitorix # While we stop monitorix sometime the built-in web server is not stopped cleanly. So are sure that everything is cleanly stoped by that # So this fix that systemctl stop monitorix.service sleep 1 pkill -f "monitorix-httpd listening on" || true ynh_check_starting ' - Ok, ready.' '/var/log/monitorix'