bulk
This commit is contained in:
@@ -20,7 +20,7 @@ if command -v synoservicectl >/dev/null 2>&1; then
|
||||
synoservicectl --stop synoindexd 2>/dev/null || true
|
||||
synoservicectl --stop pkgctl-SynoFinder 2>/dev/null || true
|
||||
elif command -v systemctl >/dev/null 2>&1; then
|
||||
systemctl stop synoindexd 2>/devnull || true
|
||||
systemctl stop synoindexd 2>/dev/null || true
|
||||
systemctl stop pkgctl-SynoFinder 2>/dev/null || true
|
||||
else
|
||||
echo " -> Service control unavailable; skipping"
|
||||
@@ -38,12 +38,22 @@ find "$TARGET_DIR" -type d -name '@eaDir' -exec echo '{}' \;
|
||||
|
||||
# 4. Remove any existing @eaDir directories
|
||||
echo "=== Removing existing @eaDir directories ==="
|
||||
find "$TARGET_DIR" -type d -name '@eaDir' -exec rm -rf '{}' \; 2>/dev/null || true
|
||||
# First make them writable so we can remove them
|
||||
find "$TARGET_DIR" -type d -name '@eaDir' -exec chmod -R 755 '{}' \; 2>/dev/null || true
|
||||
find "$TARGET_DIR" -path '*/@eaDir/*' -type f -exec chmod 644 '{}' \; 2>/dev/null || true
|
||||
# Now remove them
|
||||
find "$TARGET_DIR" -type d -name '@eaDir' -exec rm -rf '{}' \; || true
|
||||
|
||||
# 5. Rename eaDir_tmp to @eaDir (your custom thumbnails)
|
||||
echo "=== Installing custom thumbnails ==="
|
||||
# Ensure eaDir_tmp contents are writable before renaming
|
||||
find "$TARGET_DIR" -type d -name 'eaDir_tmp' -exec chmod -R 755 '{}' \; 2>/dev/null || true
|
||||
find "$TARGET_DIR" -path '*/eaDir_tmp/*' -type f -exec chmod 644 '{}' \; 2>/dev/null || true
|
||||
# Use -depth so we process children before parents, and use $1 in bash -c for safety
|
||||
find "$TARGET_DIR" -depth -type d -name 'eaDir_tmp' -exec bash -c 'd="$1"; mv "$d" "${d%/*}/@eaDir"' _ {} \; 2>/dev/null || true
|
||||
find "$TARGET_DIR" -depth -type d -name 'eaDir_tmp' -exec bash -c 'd="$1"; target="${d%/*}/@eaDir"; echo " -> Replacing $d"; rm -rf "$target"; mkdir -p "$target"; cp -a "$d/." "$target/"; rm -rf "$d"' _ {} \; || true
|
||||
# Remove any leftover eaDir_tmp directories (if rename failed)
|
||||
echo "=== Removing leftover eaDir_tmp directories ==="
|
||||
find "$TARGET_DIR" -type d -name 'eaDir_tmp' -exec rm -rf '{}' \; 2>/dev/null || true
|
||||
|
||||
# 6. Protect custom thumbnails with read-only permissions
|
||||
echo "=== Adding indexing exclusion hints ==="
|
||||
|
||||
Reference in New Issue
Block a user