diff --git a/conf/homeassistant_conf_files/bin/upgrade_homeassistant.sh b/conf/homeassistant_conf_files/bin/upgrade_homeassistant.sh index de7670b..1de83bb 100755 --- a/conf/homeassistant_conf_files/bin/upgrade_homeassistant.sh +++ b/conf/homeassistant_conf_files/bin/upgrade_homeassistant.sh @@ -8,7 +8,7 @@ DEBUG=0 # define usefull variables app="homeassistant" -final_path="/opt/yunohost/$app" +final_path="/var/www/$app" ########## END OF CONFIGURATION ########## diff --git a/scripts/install b/scripts/install index a34a207..1b52cef 100644 --- a/scripts/install +++ b/scripts/install @@ -15,7 +15,7 @@ domain=$YNH_APP_ARG_DOMAIN is_public=$YNH_APP_ARG_IS_PUBLIC # definie useful vars -final_path="/opt/yunohost/$app" +final_path="/var/www/$app" data_path="/home/yunohost.app/$app" log_file="/var/log/$app/$app.log" path_url="/" diff --git a/scripts/upgrade b/scripts/upgrade index 3d8f5b2..9a52847 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,7 +16,7 @@ port=$(ynh_app_setting_get --app="$app" --key=port) # definie useful vars if [ -z $(ynh_app_setting_get --app="$app" --key=final_path) ]; then - final_path="/opt/yunohost/$app" + final_path="/var/www/$app" data_path="/home/yunohost.app/$app" log_file="/var/log/$app/$app.log" path_url="/" @@ -52,6 +52,11 @@ ynh_systemd_action --service_name="$app" --action=stop --line_match="Stopped Hom # migrate to new app architecture ynh_script_progression --message="If needed, migrating to new app architecture..." +if [ ! -d "$final_path" ]; then + # move $final_path to new directory + mv "/opt/yunohost/$app" "$final_path" + chown -R $app: "$final_path" +fi if [ ! -d "$data_path" ]; then # remove pip cache ynh_secure_remove --file="/home/homeassistant/.cache"