mirror of
https://github.com/YunoHost-Apps/calibreweb_ynh.git
synced 2024-09-03 18:16:20 +02:00
Restore access to multimedia folders
This commit is contained in:
parent
cc6c451acb
commit
35f939bc43
1 changed files with 29 additions and 15 deletions
|
@ -66,6 +66,7 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei
|
||||||
# Create the dedicated user (if not existing)
|
# Create the dedicated user (if not existing)
|
||||||
ynh_system_user_create --username=$app
|
ynh_system_user_create --username=$app
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -81,6 +82,7 @@ ynh_restore_file --origin_path="$final_path"
|
||||||
chown -R $app: $final_path
|
chown -R $app: $final_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
#=================================================
|
#=================================================
|
||||||
# REINSTALL DEPENDENCIES
|
# REINSTALL DEPENDENCIES
|
||||||
|
@ -127,14 +129,24 @@ chown -R $app:$app /var/log/$app
|
||||||
# RESTORE THE DATA DIRECTORY
|
# RESTORE THE DATA DIRECTORY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Restoring data directory..." --weight=2
|
ynh_script_progression --message="Restoring data directory if required..." --weight=2
|
||||||
# The data directory will be restored only if it exists in the backup archive
|
# The data directory will be restored only if it exists in the backup archive
|
||||||
# So only if it was backup previously.
|
# So only if it was backup previously.
|
||||||
|
#if [ -d "$YNH_BACKUP_DIR/apps/$app/backup/$calibre_dir" ] && [ ! tail "$calibre_dir" | grep "yunohost.multimedia" ]; then
|
||||||
if [ -d "$YNH_BACKUP_DIR/apps/$app/backup/$calibre_dir" ]
|
|
||||||
then
|
|
||||||
ynh_restore_file --origin_path="$calibre_dir" --not_mandatory
|
ynh_restore_file --origin_path="$calibre_dir" --not_mandatory
|
||||||
else
|
#fi
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE THE MULTIMEDIA DIR IF NOT EXISTING
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring the multimedia directory..." --weight=5
|
||||||
|
ynh_multimedia_build_main_dir
|
||||||
|
ynh_multimedia_addaccess $app
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# INITIALIZE DATA IF NOT EXISTING
|
||||||
|
#=================================================
|
||||||
|
|
||||||
if [ ! -e "$calibre_dir" ]; then
|
if [ ! -e "$calibre_dir" ]; then
|
||||||
ynh_print_info "Create calibre library folder $calibre_dir"
|
ynh_print_info "Create calibre library folder $calibre_dir"
|
||||||
mkdir -p $calibre_dir
|
mkdir -p $calibre_dir
|
||||||
|
@ -145,7 +157,9 @@ else
|
||||||
cp -a ../settings/conf/metadata.db.empty $calibre_dir/metadata.db
|
cp -a ../settings/conf/metadata.db.empty $calibre_dir/metadata.db
|
||||||
chown $app:$app $calibre_dir/*
|
chown $app:$app $calibre_dir/*
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Update Imagick policy as per https://github.com/janeczku/calibre-web/wiki/FAQ#what-to-do-if-cover-pictures-are-not-extracted-from-pdf-files
|
#Update Imagick policy as per https://github.com/janeczku/calibre-web/wiki/FAQ#what-to-do-if-cover-pictures-are-not-extracted-from-pdf-files
|
||||||
ynh_replace_string --match_string="<policy domain="coder" rights="none" pattern="PDF" />" \
|
ynh_replace_string --match_string="<policy domain="coder" rights="none" pattern="PDF" />" \
|
||||||
|
|
Loading…
Add table
Reference in a new issue