1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/xwiki_ynh.git synced 2024-09-03 20:36:11 +02:00
xwiki_ynh/scripts/change_url
2024-04-27 01:00:20 +02:00

58 lines
1.9 KiB
Bash

#!/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 a systemd service..." --weight=1
ynh_systemd_action --service_name="$app" --action=stop
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
ynh_change_url_nginx_config
ynh_script_progression --message="Updating xwiki configuration..." --weight=1
if [ "$new_path" != "$old_path" ]; then
if "$install_on_root"; then
mv "$install_dir/webapps$old_path" "$install_dir"/webapps/root
elif [ "$path" == /root ]; then
ynh_die --message='Path "/root" not supported'
elif [ $old_path == / ]; then
mv "$install_dir"/webapps/root "$install_dir/webapps$new_path"
else
mv "$install_dir/webapps$old_path" "$install_dir/webapps$new_path"
fi
fi
add_config
set_permissions
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name="$app" --action=start --log_path=systemd --line_match="$systemd_match_start_line"
wait_xwiki_started
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last