home · contact · privacy
Fix.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 17 Apr 2025 21:32:33 +0000 (23:32 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 17 Apr 2025 21:32:33 +0000 (23:32 +0200)
bookworm/scripts/lib/copy_dirtrees_of_tags

index d4b3286fca422289c317b1f7dba58db4e7a3c34d..b93884861b2f3eeab3c67be7f0e4a3f9c0536137 100644 (file)
@@ -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
 }