From 71153df1a423d7bbd390c35c6b2a33cc2dc32044 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 17 Apr 2025 23:32:33 +0200 Subject: [PATCH] Fix. --- bookworm/scripts/lib/copy_dirtrees_of_tags | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/bookworm/scripts/lib/copy_dirtrees_of_tags b/bookworm/scripts/lib/copy_dirtrees_of_tags index d4b3286..b938848 100644 --- a/bookworm/scripts/lib/copy_dirtrees_of_tags +++ b/bookworm/scripts/lib/copy_dirtrees_of_tags @@ -23,8 +23,7 @@ copy_dirtrees_of_tags() { if [ "${_FILENAME}" = 'KILL_ME' ]; then # only there to ensure directory continue fi - _IS_LINK_ME=$(echo "${_FILENAME}" | grep -E '^LINK_ME') - if [ ! -z "${_IS_LINK_ME}" ]; then + if $(echo "${_FILENAME}" | grep -E '^LINK_ME'); then _LINK_TARGET=$(cat "${_PATH_REL}" | head -1) _LINK_NAME=$(cat "${_PATH_REL}" | tail -1) if [ -z "${_LINK_NAME}" ]; then @@ -47,11 +46,9 @@ copy_dirtrees_of_tags() { # for all paths written into user home directories, chown to respective users for _PATH in ${_PATHS_WRITTEN}; do - _IS_FOR_USER=$(echo "${_PATH}" | grep -E '^/home/') - if [ -z "${_IS_FOR_USER}" ]; then - continue + if $(echo "${_PATH}" | grep -E '^/home/'); then + _USERNAME=$(echo "${_PATH}" | sed -E '/^\/home\///' | sed -E '/\/.*//i') + chown -R "${_USERNAME}:${_USERNAME}" "${_PATH}" fi - _USERNAME=$(echo "${_PATH}" | sed -E '/^\/home\///' | sed -E '/\/.*//i') - chown -R "${_USERNAME}:${_USERNAME}" "${_PATH}" done } -- 2.30.2