From a622b599605ca4a354c49afdf651ad599cd7b581 Mon Sep 17 00:00:00 2001 From: ewilly Date: Tue, 7 Dec 2021 21:21:38 +0100 Subject: [PATCH] Fix --- scripts/install | 2 ++ scripts/upgrade | 2 ++ 2 files changed, 4 insertions(+) diff --git a/scripts/install b/scripts/install index a5ad85f..2321a9e 100644 --- a/scripts/install +++ b/scripts/install @@ -45,6 +45,7 @@ ynh_system_user_create --username="$app" # create a directory for the installation of Home Assistant myynh_create_dir "$final_path" +chown -R $app: "$final_path" # create a directory with its log file myynh_create_dir "$(dirname "$log_file")" @@ -52,6 +53,7 @@ touch "$log_file" # create a directory for the datas of Home Assistant myynh_create_dir "$data_path/.cache" +chown -R $app: "$data_path" # build (if needed) & install Pyhton ynh_script_progression --message="Installing dependencies..." diff --git a/scripts/upgrade b/scripts/upgrade index 681a6e5..392f16e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,6 +55,7 @@ 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 # move $data_path to new directory @@ -62,6 +63,7 @@ if [ ! -d "$data_path" ]; then mv "$data_path/.$app/." "$data_path" rmdir "$data_path/.$app" ynh_replace_string --match_string="/home/homeassistant/.homeassistant" --replace_string="$data_path" --target_file="$data_path/configuration.yaml" + chown -R $app: "$data_path" fi if [ ! -f "$log_file" ]; then # create a directory with its log file