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

index b93884861b2f3eeab3c67be7f0e4a3f9c0536137..4fed3aefcd6bec18b47e97a52d0074f1edc085fa 100644 (file)
@@ -23,7 +23,7 @@ copy_dirtrees_of_tags() {
             if [ "${_FILENAME}" = 'KILL_ME' ]; then  # only there to ensure directory
                 continue
             fi
-            if $(echo "${_FILENAME}" | grep -E '^LINK_ME'); then
+            if [ $(echo "${_FILENAME}" | grep -E '^LINK_ME' | wc -l) -gt 0 ]; then
                 _LINK_TARGET=$(cat "${_PATH_REL}" | head -1)
                 _LINK_NAME=$(cat "${_PATH_REL}" | tail -1)
                 if [ -z "${_LINK_NAME}" ]; then
@@ -46,7 +46,7 @@ copy_dirtrees_of_tags() {
     
     # for all paths written into user home directories, chown to respective users
     for _PATH in ${_PATHS_WRITTEN}; do
-        if $(echo "${_PATH}" | grep -E '^/home/'); then
+        if [ $(echo "${_PATH}" | grep -E '^/home/' | wc -l) -gt 0 ]; then
             _USERNAME=$(echo "${_PATH}" | sed -E '/^\/home\///' | sed -E '/\/.*//i')
             chown -R "${_USERNAME}:${_USERNAME}" "${_PATH}" 
         fi