refactor: only execute chown on files that the user do not already own
Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
@@ -49,7 +49,10 @@ function set_upstream_nginx_cfg(){
|
||||
local files
|
||||
files=$(find "${BACKUP_DIR}/nginx_cfg")
|
||||
for file in ${files}; do
|
||||
if [ "$(stat -c "%U" "${file}" )" != "${USER}" ]; then
|
||||
log_info "chown for user: ${USER} on file: ${file}"
|
||||
sudo chown "${USER}" "${file}"
|
||||
fi
|
||||
done
|
||||
### copy nginx configs to target destination
|
||||
if [ ! -f "${NGINX_CONFD}/upstreams.conf" ]; then
|
||||
|
||||
Reference in New Issue
Block a user