2021-03-19 04:09:26 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2021-03-21 05:17:45 +01:00
|
|
|
ynh_script_progression --message="Stopping systemd services..." --weight=1
|
2021-03-19 04:09:26 +01:00
|
|
|
|
2021-03-21 05:17:45 +01:00
|
|
|
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"
|
2021-03-19 04:09:26 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2021-03-21 05:17:45 +01:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
2021-03-19 04:09:26 +01:00
|
|
|
|
2023-05-29 17:10:43 +02:00
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
2021-03-19 04:09:26 +01:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2021-03-21 05:17:45 +01:00
|
|
|
# MOVE TOMCAT WEBAPP FOLDER
|
2021-03-19 04:09:26 +01:00
|
|
|
#=================================================
|
|
|
|
|
2021-03-21 05:17:45 +01:00
|
|
|
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
|
|
|
|
|
2023-05-29 17:10:43 +02:00
|
|
|
mv "$install_dir/var/lib/tomcat9/webapps/$old_path_tomcat" "$install_dir/var/lib/tomcat9/webapps/$new_path_tomcat"
|
2021-03-21 05:17:45 +01:00
|
|
|
fi
|
|
|
|
|
2021-03-19 04:09:26 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
2021-03-21 05:17:45 +01:00
|
|
|
# START SYSTEMD SERVICES
|
2021-03-19 04:09:26 +01:00
|
|
|
#=================================================
|
2021-03-21 05:17:45 +01:00
|
|
|
ynh_script_progression --message="Starting systemd services..." --weight=1
|
2021-03-19 04:09:26 +01:00
|
|
|
|
2021-03-21 05:17:45 +01:00
|
|
|
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"
|
2021-03-19 04:09:26 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-03-21 05:17:45 +01:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|