mirror of
https://github.com/YunoHost-Apps/funkwhale_ynh.git
synced 2024-09-03 18:36:24 +02:00
Update data_dir
This commit is contained in:
parent
282da0d337
commit
93fec83d87
1 changed files with 11 additions and 11 deletions
|
@ -35,15 +35,14 @@ if [ -z "$data_dir/data/" ]; then
|
|||
# Do a full backup before moving datas
|
||||
yunohost backup create --apps $app
|
||||
|
||||
data_dir="/home/yunohost.app/${app}/data"
|
||||
ynh_script_progression --message="Moving datas to $data_dir..." --weight=1
|
||||
|
||||
mkdir -p $data_dir
|
||||
mkdir -p $data_dir/{static,media,music}
|
||||
mkdir -p /home/yunohost.app/${app}/data
|
||||
mkdir -p /home/yunohost.app/${app}/data/{static,media,music}
|
||||
|
||||
chmod 750 "$data_dir"
|
||||
chmod -R o-rwx "$data_dir"
|
||||
chown -R $app:www-data "$data_dir"
|
||||
chmod 750 "/home/yunohost.app/${app}/data"
|
||||
chmod -R o-rwx "/home/yunohost.app/${app}/data"
|
||||
chown -R $app:www-data "/home/yunohost.app/${app}/data"
|
||||
|
||||
ynh_backup_if_checksum_is_different --file="$install_dir/code/config/.env"
|
||||
mkdir -p $install_dir/config
|
||||
|
@ -53,23 +52,24 @@ if [ -z "$data_dir/data/" ]; then
|
|||
ynh_delete_file_checksum --file="$install_dir/code/config/.env"
|
||||
|
||||
if [ -d "$install_dir/code/data/static/" ]; then
|
||||
rsync -a $install_dir/code/data/static/ $data_dir/static/
|
||||
rsync -a $install_dir/code/data/static/ "/home/yunohost.app/${app}/data/static/"
|
||||
fi
|
||||
if [ -d "$install_dir/media/" ]; then
|
||||
rsync -a $install_dir/media/ $data_dir/media/
|
||||
rsync -a $install_dir/media/ "/home/yunohost.app/${app}/data/media/"
|
||||
fi
|
||||
if [ -d "$install_dir/code/data/media/" ]; then
|
||||
rsync -a $install_dir/code/data/media/ $data_dir/media/
|
||||
rsync -a $install_dir/code/data/media/ "/home/yunohost.app/${app}/data/media/"
|
||||
fi
|
||||
if [ -d "$install_dir/import/" ]; then
|
||||
rsync -a $install_dir/import/ $data_dir/music/
|
||||
rsync -a $install_dir/import/ "/home/yunohost.app/${app}/data/music/"
|
||||
fi
|
||||
if [ -d "$install_dir/code/data/music/" ]; then
|
||||
rsync -a $install_dir/code/data/music/ $data_dir/music/
|
||||
rsync -a $install_dir/code/data/music/ "/home/yunohost.app/${app}/data/music/"
|
||||
fi
|
||||
|
||||
ynh_secure_remove --file="$install_dir/code"
|
||||
ynh_secure_remove --file="$install_dir/media"
|
||||
ynh_secure_remove --file="$install_dir/static"
|
||||
ynh_secure_remove --file="$install_dir/code/data/media"
|
||||
ynh_secure_remove --file="$install_dir/import"
|
||||
ynh_secure_remove --file="$install_dir/code/data/music"
|
||||
|
|
Loading…
Reference in a new issue