diff --git a/scripts/upgrade b/scripts/upgrade index 9825f04..d5ce1a2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -2,6 +2,8 @@ # Retrieve arguments path=$(sudo yunohost app setting movim path) +domain=$(sudo yunohost app setting movim domain) +port=$(sudo yunohost app setting movim port) # Install Movim files final_path=/var/www/movim @@ -26,6 +28,9 @@ sudo su -c "cd $final_path && php composer.phar install" movim sudo sed -i "s@/ws/@$path/ws/@g" $final_path/app/assets/js/movim_websocket.js # Update init scripts +sudo sed -i "s@YHURL@$domain$path@g" ../conf/movim.{service,init} +sudo sed -i "s@YHDIR@$final_path@g" ../conf/movim.{service,init} +sudo sed -i "s@YHPORT@$port@g" ../conf/movim.{service,init} initcheck=`pgrep -ox systemd` if [ "$initcheck" = "1" ]; then @@ -44,4 +49,4 @@ fi # Reload sudo yunohost app ssowatconf -sudo movim restart +sudo service movim restart