1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/BicBucStriim_ynh.git synced 2024-09-03 18:15:53 +02:00
This commit is contained in:
ericgaspar 2021-07-07 10:16:00 +02:00
parent 43cd2b4440
commit 88375345c4
4 changed files with 17 additions and 18 deletions

View file

@ -21,9 +21,11 @@ ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
admin=$(ynh_app_setting_get --app=$app --key=admin)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
@ -36,8 +38,11 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$final_path"
books_path=/home/$admin/calibre_library
ynh_backup "$books_path" "data"
#=================================================
# BACKUP THE DATA DIR
#=================================================
ynh_backup --src_path="$datadir" --is_big
#=================================================
# BACKUP THE NGINX CONFIGURATION

View file

@ -16,9 +16,10 @@ ynh_script_progression --message="Loading installation settings..." --weight=3
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get "$app" domain)
admin=$(ynh_app_setting_get "$app" admin)
books_path=/home/$admin/calibre_library
domain=$(ynh_app_setting_get --app=$app --key=domain)
admin=$(ynh_app_setting_get --app=$app --key=admin)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# REMOVE APP MAIN DIR
@ -34,7 +35,7 @@ ynh_secure_remove --file="$final_path"
ynh_script_progression --message="Removing app main directory..." --weight=4
# Remove the app directory securely
ynh_secure_remove --file="$books_path"
ynh_secure_remove --file="$datadir"
#=================================================
# REMOVE NGINX CONFIGURATION

View file

@ -27,6 +27,8 @@ domain=$(ynh_app_setting_get "$app" domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get "$app" admin)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
@ -71,7 +73,7 @@ chown -R $app:www-data "$final_path"
# you may need to make some file and/or directory writeable by www-data (nginx user)
chown -R root: "$final_path"
chown -R $admin "$books_path"
chown -R $admin "$datadir"
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION

View file

@ -17,11 +17,11 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get "$app" domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get "$app" admin)
is_public=$(ynh_app_setting_get "$app" is_public)
language=$(ynh_app_setting_get "$app" language)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# CHECK VERSION
@ -54,12 +54,6 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
# If db_name doesn't exist, create it
if [ -z "$db_name" ]; then
db_name=$(ynh_sanitize_dbid --db_name=$app)
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
@ -85,9 +79,6 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=7
# Create a temporary directory
#tmpdir="$(ynh_smart_mktemp --min_size=10)"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
fi