1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mobilizon_ynh.git synced 2024-09-03 19:46:19 +02:00

Move uploads files

This commit is contained in:
yalh76 2021-04-25 19:19:22 +02:00
parent da1efc72e4
commit 4c50647173

View file

@ -119,6 +119,14 @@ if ynh_version_gt "1.0.0~ynh1" "${previous_version}" ; then
ynh_store_file_checksum --file="$config" ynh_store_file_checksum --file="$config"
fi fi
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# CREATE DATADIR FOLDER # CREATE DATADIR FOLDER
#================================================= #=================================================
@ -140,6 +148,8 @@ if [ -z "$datadir" ]; then
chmod -R o-rwx "$datadir" chmod -R o-rwx "$datadir"
chown -R $app:$app "$datadir" chown -R $app:$app "$datadir"
rsync -a $final_path/$app/uploads/ $datadir/uploads/
config="$final_path/$app/config/prod.secret.exs" config="$final_path/$app/config/prod.secret.exs"
ynh_backup_if_checksum_is_different --file="$config" ynh_backup_if_checksum_is_different --file="$config"
@ -151,16 +161,10 @@ if [ -z "$datadir" ]; then
chmod 400 "$config" chmod 400 "$config"
chown $app:$app "$config" chown $app:$app "$config"
ynh_secure_remove --file="$final_path/$app/uploads"
fi fi
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================