1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dokuwiki_ynh.git synced 2024-09-03 18:26:20 +02:00

Delete sudo for xargs

This commit is contained in:
magikcypress 2017-03-08 18:15:01 +01:00
parent d087ae95ef
commit 10ef9d880f
2 changed files with 9 additions and 9 deletions

View file

@ -56,9 +56,9 @@ SETUP_SOURCE "dokuwiki-c5525093cf2c4f47e2e5d2439fe13964.tgz"
sudo cp ../conf/dokuwiki.php $final_path/conf
sudo cp ../conf/acl.auth.php $final_path/conf
# Files owned by root, www-data can just read
find $final_path -type f -print0 | sudo xargs -0 chmod 0644
find $final_path -type d -print0 | sudo xargs -0 chmod 0755
# Files owned by www-data can just read
sudo find $final_path -type f -print0 | xargs -0 chmod 0644
sudo find $final_path -type d -print0 | xargs -0 chmod 0755
sudo chown -R www-data: $final_path
# except for conf, data, some data subfolders, and lib/plugin, where www-data must have write permissions

View file

@ -1,7 +1,7 @@
#!/bin/bash
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
set -e
# Exit on command errors and treat unset variables as an error
set -eu
# Source app helpers
source /usr/share/yunohost/helpers
@ -59,10 +59,10 @@ sudo touch $final_path/doku.php
# See https://www.dokuwiki.org/install:unused_files
grep -Ev '^($|#)' ../sources/data/deleted.files | xargs -I {} sudo rm -vrf $final_path/{}
# Files owned by root, www-data can just read
find $final_path -type f -print0 | sudo xargs -0 chmod 0644
find $final_path -type d -print0 | sudo xargs -0 chmod 0755
sudo chown -R root: $final_path
# Files owned by www-data can just read
sudo find $final_path -type f -print0 | xargs -0 chmod 0644
sudo find $final_path -type d -print0 | xargs -0 chmod 0755
sudo chown -R www-data: $final_path
# except for conf, data, some data subfolders, and lib/plugin, where www-data must have write permissions
sudo chown -R www-data:root $final_path/{conf,data,data/attic,data/cache,data/index,data/locks,data/media*,data/meta,data/pages,data/tmp,lib/plugins,lib/tpl}