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

Move final path to var_www

This commit is contained in:
ewilly 2021-12-07 17:29:01 +01:00
parent 996edf6b89
commit ffa53e5d45
3 changed files with 8 additions and 3 deletions

View file

@ -8,7 +8,7 @@ DEBUG=0
# define usefull variables # define usefull variables
app="homeassistant" app="homeassistant"
final_path="/opt/yunohost/$app" final_path="/var/www/$app"
########## END OF CONFIGURATION ########## ########## END OF CONFIGURATION ##########

View file

@ -15,7 +15,7 @@ domain=$YNH_APP_ARG_DOMAIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
# definie useful vars # definie useful vars
final_path="/opt/yunohost/$app" final_path="/var/www/$app"
data_path="/home/yunohost.app/$app" data_path="/home/yunohost.app/$app"
log_file="/var/log/$app/$app.log" log_file="/var/log/$app/$app.log"
path_url="/" path_url="/"

View file

@ -16,7 +16,7 @@ port=$(ynh_app_setting_get --app="$app" --key=port)
# definie useful vars # definie useful vars
if [ -z $(ynh_app_setting_get --app="$app" --key=final_path) ]; then 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" data_path="/home/yunohost.app/$app"
log_file="/var/log/$app/$app.log" log_file="/var/log/$app/$app.log"
path_url="/" path_url="/"
@ -52,6 +52,11 @@ ynh_systemd_action --service_name="$app" --action=stop --line_match="Stopped Hom
# migrate to new app architecture # migrate to new app architecture
ynh_script_progression --message="If needed, migrating 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 if [ ! -d "$data_path" ]; then
# remove pip cache # remove pip cache
ynh_secure_remove --file="/home/homeassistant/.cache" ynh_secure_remove --file="/home/homeassistant/.cache"