HEX
Server: Apache
System: Linux pdx1-shared-a1-29 6.18.39-grsec-noble+ #4 SMP Thu Jul 23 07:53:29 UTC 2026 x86_64
User: dh_bj99yp (22285841)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //sbin/update-icon-caches
#!/bin/sh

case "$1" in
    ""|-h|--help)
        echo "Usage: $0 directory [ ... ]"
        exit 1
        ;;
esac

for dir in "$@"; do
    if [ ! -d "$dir" ]; then
        continue
    fi
    if [ -f "$dir"/index.theme ]; then
        # Generate or regenerate the cache    
        if ! gtk-update-icon-cache --force --quiet "$dir"; then
            echo "WARNING: icon cache generation failed for $dir"
        fi
    else
        # No more index.theme, remove the cache if it exists
        rm -f "$dir"/icon-theme.cache
        rmdir -p --ignore-fail-on-non-empty "$dir"
    fi
done

exit 0