From 2238345faeb298424d9182fb5ebf37da0046e6bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Dufraisse?= Date: Sat, 27 Nov 2021 12:48:13 +0100 Subject: [PATCH] feat(_commons): Create helper for ir rigthss --- scripts/_common.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 6aa5058..2ea1bc6 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -15,6 +15,19 @@ loginldap_version="2021-03-01-2" # PERSONAL HELPERS #================================================= +# update directory right +# | arg: app - The application's name ; default : yeswiki +# | arg: final_path - The path of the application's folder +# yeswiki_update_dir_rights yeswiki /var/www/yeswiki +yeswiki_update_dir_rights() { + local app="${1:-yeswiki}" + local final_path="${2}" + + chown -R $app:$app $final_path + chmod -R u=rwX,g=rwX,o-rwx $final_path + chmod -R o+rwX $final_path/{cache,files} +} + #================================================= # EXPERIMENTAL HELPERS #=================================================