mirror of
https://github.com/YunoHost-Apps/piwigo_ynh.git
synced 2024-09-03 20:06:03 +02:00
Handle already existing data_dir
This commit is contained in:
parent
d04719a32f
commit
af96ff8b18
1 changed files with 16 additions and 3 deletions
|
@ -29,9 +29,22 @@ chown -R "$app:www-data" "$install_dir"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Initializing data directory..." --weight=1
|
||||
|
||||
mv "$install_dir/_data" "$data_dir/_data"
|
||||
mv "$install_dir/upload" "$data_dir/upload"
|
||||
mv "$install_dir/galleries" "$data_dir/galleries"
|
||||
# Move data dirs to $data_dir unless they already exist
|
||||
if [ -d "$install_dir/_data" ]; then
|
||||
ynh_secure_remove "$install_dir/_data"
|
||||
else
|
||||
mv "$install_dir/_data" "$data_dir/_data"
|
||||
fi
|
||||
if [ -d "$install_dir/galleries" ]; then
|
||||
ynh_secure_remove "$install_dir/galleries"
|
||||
else
|
||||
mv "$install_dir/galleries" "$data_dir/galleries"
|
||||
fi
|
||||
if [ -d "$install_dir/upload" ]; then
|
||||
ynh_secure_remove "$install_dir/upload"
|
||||
else
|
||||
mv "$install_dir/upload" "$data_dir/upload"
|
||||
fi
|
||||
|
||||
chmod -R o-rwx "$data_dir"
|
||||
chown -R "$app:www-data" "$data_dir"
|
||||
|
|
Loading…
Reference in a new issue