#!/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 systemd services..." --weight=1 ynh_systemd_action --service_name="$app-guacd" --action="stop" --log_path="/var/log/$app/guacd.log" ynh_systemd_action --service_name="$app-tomcat" --action="stop" --log_path="/var/log/$app/tomcat.log" #================================================= # MODIFY URL IN NGINX CONF #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 ynh_change_url_nginx_config #================================================= # SPECIFIC MODIFICATIONS #================================================= # MOVE TOMCAT WEBAPP FOLDER #================================================= if [ $change_path -eq 1 ]; then ynh_script_progression --message="Moving Tomcat webbapp folder..." --weight=1 old_path_tomcat="$old_path" if [ "$old_path_tomcat" == "/" -o -z "$old_path_tomcat" ]; then old_path_tomcat="ROOT" fi new_path_tomcat="$new_path" if [ "$new_path_tomcat" == "/" -o -z "$new_path_tomcat" ]; then new_path_tomcat="ROOT" fi mv "$install_dir/var/lib/tomcat9/webapps/$old_path_tomcat" "$install_dir/var/lib/tomcat9/webapps/$new_path_tomcat" fi #================================================= # GENERIC FINALISATION #================================================= # START SYSTEMD SERVICES #================================================= ynh_script_progression --message="Starting systemd services..." --weight=1 ynh_systemd_action --service_name="$app-guacd" --action="start" --log_path="/var/log/$app/guacd.log" ynh_systemd_action --service_name="$app-tomcat" --action="start" --log_path="/var/log/$app/tomcat.log" #================================================= # END OF SCRIPT #================================================= ynh_script_progression --message="Change of URL completed for $app" --last