1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galene_ynh.git synced 2024-09-03 18:36:31 +02:00

Fix upgrade

This commit is contained in:
ericgaspar 2021-02-25 12:24:45 +01:00
parent ec8b46e7b7
commit 2b2a5b83b4
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 19 additions and 13 deletions

View file

@ -70,7 +70,7 @@ fi
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log"
#=================================================
# MODIFY URL IN NGINX CONF

View file

@ -43,18 +43,6 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
# If groups folder doesn't exist, create it
if [ -z "$final_path/groups" ]; then
# Create groups folders
mkdir -p "$final_path/groups"
fi
# If data folder doesn't exist, create it
if [ -z "$final_path/data" ]; then
# Create groups folders
mkdir -p "$final_path/data"
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -97,6 +85,13 @@ then
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
# Define app's data and groups directory
data="$final_path/data"
groups="$final_path/groups"
# Create data and groups folder
mkdir -p "$data"
mkdir -p "$groups"
# Copy the admin saved settings from tmp directory to final path
cp -ar "$tmpdir/groups" "$final_path/groups"
@ -132,9 +127,20 @@ ynh_system_user_create --username=$app
#=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
public_ip4="$(curl ip.yunohost.org)" || true
ynh_replace_string --match_string="__IPV4__" --replace_string="$public_ip4" --target_file="../conf/systemd.service"
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_add_config --template="../conf/passwd" --destination="$final_path/data/passwd"
ynh_store_file_checksum --file="$final_path/data/passwd"
#=================================================
# GENERIC FINALIZATION
#=================================================