From 9ce721b2b2018f73b35b49d979e1c5c6d1e7118b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 11 Jun 2023 14:23:57 +0200 Subject: [PATCH] Add -r to xargs to not miserably fail when find doesn't list any file --- scripts/install | 8 ++++---- scripts/restore | 8 ++++---- scripts/upgrade | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index 19dcb67..102e984 100755 --- a/scripts/install +++ b/scripts/install @@ -336,10 +336,10 @@ ynh_multimedia_addaccess $app # Fix app ownerships & permissions chown -R $app:www-data "$final_path" chown -R $app: "$datadir" -find $final_path/ -type f -print0 | xargs -0 chmod 0644 -find $final_path/ -type d -print0 | xargs -0 chmod 0755 -find $datadir/ -type f -print0 | xargs -0 chmod 0640 -find $datadir/ -type d -print0 | xargs -0 chmod 0750 +find $final_path/ -type f -print0 | xargs -r0 chmod 0644 +find $final_path/ -type d -print0 | xargs -r0 chmod 0755 +find $datadir/ -type f -print0 | xargs -r0 chmod 0640 +find $datadir/ -type d -print0 | xargs -r0 chmod 0750 chmod 640 "$final_path/config/config.php" chmod 755 /home/yunohost.app chmod 750 $final_path diff --git a/scripts/restore b/scripts/restore index 83c233f..42e6dcc 100755 --- a/scripts/restore +++ b/scripts/restore @@ -139,10 +139,10 @@ mkdir -p "$datadir" # Fix app ownerships & permissions chown -R $app:www-data "$final_path" chown -R $app: "$datadir" -find $final_path/ -type f -print0 | xargs -0 chmod 0644 -find $final_path/ -type d -print0 | xargs -0 chmod 0755 -find $datadir/ -type f -print0 | xargs -0 chmod 0640 -find $datadir/ -type d -print0 | xargs -0 chmod 0750 +find $final_path/ -type f -print0 | xargs -r0 chmod 0644 +find $final_path/ -type d -print0 | xargs -r0 chmod 0755 +find $datadir/ -type f -print0 | xargs -r0 chmod 0640 +find $datadir/ -type d -print0 | xargs -r0 chmod 0750 chmod 640 "$final_path/config/config.php" chmod 755 /home/yunohost.app chmod 750 $final_path diff --git a/scripts/upgrade b/scripts/upgrade index b7a7fcc..eb1adb6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -452,10 +452,10 @@ exec_occ background:cron # Fix app ownerships & permissions chown -R $app:www-data "$final_path" chown -R $app: "$datadir" -find $final_path/ -type f -print0 | xargs -0 chmod 0644 -find $final_path/ -type d -print0 | xargs -0 chmod 0755 -find $datadir/ -type f -print0 | xargs -0 chmod 0640 -find $datadir/ -type d -print0 | xargs -0 chmod 0750 +find $final_path/ -type f -print0 | xargs -r0 chmod 0644 +find $final_path/ -type d -print0 | xargs -r0 chmod 0755 +find $datadir/ -type f -print0 | xargs -r0 chmod 0640 +find $datadir/ -type d -print0 | xargs -r0 chmod 0750 chmod 640 "$final_path/config/config.php" chmod 755 /home/yunohost.app chmod 750 $final_path