From 5bfd645872a200e3a1fadb331c12bc27a2f803ee Mon Sep 17 00:00:00 2001 From: ewilly Date: Sun, 28 Nov 2021 14:47:09 +0100 Subject: [PATCH] Fix --- scripts/install | 8 ++------ scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index e5bbdd8..d5ad9a6 100644 --- a/scripts/install +++ b/scripts/install @@ -54,7 +54,7 @@ chown $app: "$final_path" # create a directory with its log file myynh_create_dir "$(dirname "$log_file")" touch "$log_file" -chown $app: "$log_file" +chown -R $app: "$(dirname "$log_file")" # create a directory for the datas of Home Assistant myynh_create_dir "$data_path/.$app" @@ -67,9 +67,7 @@ myynh_install_dependencies --python="$PY_REQUIRED_VERSION" # installation in a virtual environment ynh_script_progression --message="Installing Home Assistant in a virtual environment..." -ynh_print_info --message="$(whoami)" ynh_exec_fully_quiet myynh_install_homeassistant --path="$data_path" -ynh_print_info --message="$(whoami)" # set default configuration files and move all homeassistant_conf_files ynh_script_progression --message="Configuring the installation..." @@ -79,14 +77,12 @@ ynh_replace_string --match_string="__DATAPATH__" --replace_string="$data_path" - cp -r "../conf/homeassistant_conf_files/." "$data_path/.$app/" chown -R $app: "$data_path/.$app" chmod -R +x "$data_path/.$app/bin/" -ynh_print_info --message="$(whoami)" # setup up systemd service ynh_script_progression --message="Adding the dedicated service..." ynh_replace_string --match_string="__DATAPATH__" --replace_string="$data_path" --target_file="../conf/systemd.service" ynh_replace_string --match_string="__LOGFILE__" --replace_string="$log_file" --target_file="../conf/systemd.service" -ynh_add_systemd_config --service="$app" -ynh_print_info --message="$(whoami)" +ynh_add_systemd_config ## add service in admin panel yunohost service add "$app" --log "$log_file" --description "Home Assistant server" --needs_exposed_ports $port diff --git a/scripts/upgrade b/scripts/upgrade index b567fbd..1aead03 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -66,7 +66,7 @@ if [ ! -f "$log_file" ]; then # create a directory with its log file myynh_create_dir "$(dirname "$log_file")" touch "$log_file" - chown $app: "$log_file" + chown -R $app: "$(dirname "$log_file")" fi if [ -f "/etc/systemd/system/$app@$app.service" ]; then # remove old systemd service @@ -90,7 +90,7 @@ chmod -R +x "$data_path/.$app/bin/" ynh_script_progression --message="Adding the dedicated service..." ynh_replace_string --match_string="__DATAPATH__" --replace_string="$data_path" --target_file="../conf/systemd.service" ynh_replace_string --match_string="__LOGFILE__" --replace_string="$log_file" --target_file="../conf/systemd.service" -ynh_add_systemd_config --service="$app" +ynh_add_systemd_config # add service in admin panel yunohost service add "$app" --log "$log_file" --description "Home Assistant server" --needs_exposed_ports $port