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

Add -r to xargs to not miserably fail when find doesn't list any file

This commit is contained in:
Alexandre Aubin 2023-06-11 14:23:57 +02:00
parent fe098e6e6b
commit 9ce721b2b2
3 changed files with 12 additions and 12 deletions

View file

@ -336,10 +336,10 @@ ynh_multimedia_addaccess $app
# Fix app ownerships & permissions # Fix app ownerships & permissions
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
chown -R $app: "$datadir" chown -R $app: "$datadir"
find $final_path/ -type f -print0 | xargs -0 chmod 0644 find $final_path/ -type f -print0 | xargs -r0 chmod 0644
find $final_path/ -type d -print0 | xargs -0 chmod 0755 find $final_path/ -type d -print0 | xargs -r0 chmod 0755
find $datadir/ -type f -print0 | xargs -0 chmod 0640 find $datadir/ -type f -print0 | xargs -r0 chmod 0640
find $datadir/ -type d -print0 | xargs -0 chmod 0750 find $datadir/ -type d -print0 | xargs -r0 chmod 0750
chmod 640 "$final_path/config/config.php" chmod 640 "$final_path/config/config.php"
chmod 755 /home/yunohost.app chmod 755 /home/yunohost.app
chmod 750 $final_path chmod 750 $final_path

View file

@ -139,10 +139,10 @@ mkdir -p "$datadir"
# Fix app ownerships & permissions # Fix app ownerships & permissions
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
chown -R $app: "$datadir" chown -R $app: "$datadir"
find $final_path/ -type f -print0 | xargs -0 chmod 0644 find $final_path/ -type f -print0 | xargs -r0 chmod 0644
find $final_path/ -type d -print0 | xargs -0 chmod 0755 find $final_path/ -type d -print0 | xargs -r0 chmod 0755
find $datadir/ -type f -print0 | xargs -0 chmod 0640 find $datadir/ -type f -print0 | xargs -r0 chmod 0640
find $datadir/ -type d -print0 | xargs -0 chmod 0750 find $datadir/ -type d -print0 | xargs -r0 chmod 0750
chmod 640 "$final_path/config/config.php" chmod 640 "$final_path/config/config.php"
chmod 755 /home/yunohost.app chmod 755 /home/yunohost.app
chmod 750 $final_path chmod 750 $final_path

View file

@ -452,10 +452,10 @@ exec_occ background:cron
# Fix app ownerships & permissions # Fix app ownerships & permissions
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
chown -R $app: "$datadir" chown -R $app: "$datadir"
find $final_path/ -type f -print0 | xargs -0 chmod 0644 find $final_path/ -type f -print0 | xargs -r0 chmod 0644
find $final_path/ -type d -print0 | xargs -0 chmod 0755 find $final_path/ -type d -print0 | xargs -r0 chmod 0755
find $datadir/ -type f -print0 | xargs -0 chmod 0640 find $datadir/ -type f -print0 | xargs -r0 chmod 0640
find $datadir/ -type d -print0 | xargs -0 chmod 0750 find $datadir/ -type d -print0 | xargs -r0 chmod 0750
chmod 640 "$final_path/config/config.php" chmod 640 "$final_path/config/config.php"
chmod 755 /home/yunohost.app chmod 755 /home/yunohost.app
chmod 750 $final_path chmod 750 $final_path