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 #=================================================