mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
find files before chown them
This commit is contained in:
parent
12024a67e0
commit
e215d9c5c9
3 changed files with 12 additions and 9 deletions
|
@ -64,7 +64,8 @@ exec_occ() {
|
|||
}
|
||||
|
||||
# Set write access for the following commands
|
||||
chown -R $app: "$install_dir" "$data_dir"
|
||||
find "$install_dir" -not \( -user $app -or -group www-data \) -exec chown $app:www-data {} \+
|
||||
find "$data_dir" -not \( -user $app -or -group $app \) -exec chown $app: {} \+
|
||||
|
||||
# Define password in an intermediate var
|
||||
# The fact that it's called _password allows it to be
|
||||
|
@ -234,8 +235,8 @@ ynh_multimedia_addaccess $app
|
|||
#=================================================
|
||||
|
||||
# Fix app ownerships & permissions
|
||||
chown -R $app:www-data "$install_dir"
|
||||
chown -R $app: "$data_dir"
|
||||
find "$install_dir" -not \( -user $app -or -group www-data \) -exec chown $app:www-data {} \+
|
||||
find "$data_dir" -not \( -user $app -or -group $app \) -exec chown $app: {} \+
|
||||
find $install_dir/ -type f -print0 | xargs -r0 chmod 0644
|
||||
find $install_dir/ -type d -print0 | xargs -r0 chmod 0755
|
||||
find $data_dir/data/ -type f -print0 | xargs -r0 chmod 0640
|
||||
|
|
|
@ -79,8 +79,8 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory
|
|||
#=================================================
|
||||
|
||||
# Fix app ownerships & permissions
|
||||
chown -R $app:www-data "$install_dir"
|
||||
chown -R $app: "$data_dir"
|
||||
find "$install_dir" -not \( -user $app -or -group www-data \) -exec chown $app:www-data {} \+
|
||||
find "$data_dir" -not \( -user $app -or -group $app \) -exec chown $app: {} \+
|
||||
find $install_dir/ -type f -print0 | xargs -r0 chmod 0644
|
||||
find $install_dir/ -type d -print0 | xargs -r0 chmod 0755
|
||||
find $data_dir/data/ -type f -print0 | xargs -r0 chmod 0640
|
||||
|
|
|
@ -138,7 +138,8 @@ then
|
|||
ynh_script_progression --message="Upgrading $app..." --weight=3
|
||||
|
||||
# Set write access for the following commands
|
||||
chown -R $app: "$install_dir" "$data_dir"
|
||||
find "$install_dir" -not \( -user $app -or -group www-data \) -exec chown $app:www-data {} \+
|
||||
find "$data_dir" -not \( -user $app -or -group $app \) -exec chown $app: {} \+
|
||||
|
||||
# Print the current version number of Nextcloud
|
||||
exec_occ -V
|
||||
|
@ -207,7 +208,8 @@ then
|
|||
mv "$tmpdir" "$install_dir"
|
||||
|
||||
# Set write access for the following commands
|
||||
chown -R $app: "$install_dir" "$data_dir"
|
||||
find "$install_dir" -not \( -user $app -or -group www-data \) -exec chown $app:www-data {} \+
|
||||
find "$data_dir" -not \( -user $app -or -group $app \) -exec chown $app: {} \+
|
||||
|
||||
# Upgrade Nextcloud (SUCCESS = 0, UP_TO_DATE = 3)
|
||||
exec_occ maintenance:mode --off
|
||||
|
@ -324,8 +326,8 @@ fi
|
|||
ynh_script_progression --message="Reapplying file permissions..." --weight=2
|
||||
|
||||
# Fix app ownerships & permissions
|
||||
chown -R $app:www-data "$install_dir"
|
||||
chown -R $app: "$data_dir"
|
||||
find "$install_dir" -not \( -user $app -or -group www-data \) -exec chown $app:www-data {} \+
|
||||
find "$data_dir" -not \( -user $app -or -group $app \) -exec chown $app: {} \+
|
||||
find $install_dir/ -type f -print0 | xargs -r0 chmod 0644
|
||||
find $install_dir/ -type d -print0 | xargs -r0 chmod 0755
|
||||
find $data_dir/data/ -type f -print0 | xargs -r0 chmod 0640
|
||||
|
|
Loading…
Add table
Reference in a new issue