1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/petrolette_ynh.git synced 2024-09-03 19:56:26 +02:00

use relative path

This commit is contained in:
oiseauroch 2022-11-17 12:10:17 +01:00
parent c791d39044
commit 36f4637785
3 changed files with 2 additions and 13 deletions

View file

@ -72,17 +72,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
if [ $change_path -eq 1 ]
then
if [ $old_path = "/" ] ; then
sed -i "s|\$.get(\"/feed\", {|\$.get(\"$path_url/feed\", {|" public/js/PTL.feed.js
else if [ $new_path = "/" ] ; then
sed -i "s|\$.get(\"$old_path/feed\", {|\$.get(\"/feed\", {|" public/js/PTL.feed.js
else
sed -i "s|\$.get(\"$old_path/feed\", {|\$.get(\"$path_url/feed\", {|" public/js/PTL.feed.js
fi
fi
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================

View file

@ -112,7 +112,7 @@ pushd $final_path
ynh_add_config --template="petrolette.config.json" --destination="petrolette.config.json" ynh_add_config --template="petrolette.config.json" --destination="petrolette.config.json"
fi fi
if [ "$path_url" != "/" ] ; then if [ "$path_url" != "/" ] ; then
sed -i "s|\$.get(\"/feed\", {|\$.get(\"$path_url/feed\", {|" public/js/PTL.feed.js sed -i "s|\$.get(\"/feed\", {|\$.get(\"feed\", {|" public/js/PTL.feed.js
fi fi
[[ -v HOME ]] && TMP_HOME=$HOME [[ -v HOME ]] && TMP_HOME=$HOME
HOME=$(pwd) HOME=$(pwd)

View file

@ -100,7 +100,7 @@ pushd $final_path
sed -i "/HTTP_PORT/s/[0-9]*[0-9]/$port/" package.json sed -i "/HTTP_PORT/s/[0-9]*[0-9]/$port/" package.json
sed -i "/HTTPS_PORT/s/[0-9]*[0-9]/$https_port/" package.json sed -i "/HTTPS_PORT/s/[0-9]*[0-9]/$https_port/" package.json
if [ "$path_url" != "/" ] ; then if [ "$path_url" != "/" ] ; then
sed -i "s|\$.get(\"/feed\", {|\$.get(\"$path_url/feed\", {|" public/js/PTL.feed.js sed -i "s|\$.get(\"/feed\", {|\$.get(\"feed\", {|" public/js/PTL.feed.js
fi fi
[[ -v HOME ]] && TMP_HOME=$HOME [[ -v HOME ]] && TMP_HOME=$HOME