1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/snweb_ynh.git synced 2024-09-03 20:26:22 +02:00
snweb_ynh/scripts/change_url
2024-01-18 10:42:33 +01:00

38 lines
1.4 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
ynh_change_url_nginx_config
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
ynh_script_progression --message="Modify Configuration..." --weight=1
if [ $change_path -eq 1 ]; then
cp "$install_dir/live/packages/web/dist/app.js.orginal" "$install_dir/live/packages/web/dist/app.js"
# If $new_path is used modify .js file for a working app on a subpath
if [ $new_path != "/" ]; then
ynh_replace_string --match_string="/components/" --replace_string="$new_path/components/" --target_file="$install_dir/live/packages/web/dist/app.js"
fi
fi
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last