#!/bin/sh -e no_fonts_uninstall=`mktemp` trap 'rm -f -- "$no_fonts_uninstall"' EXIT HUP INT QUIT TERM egrep -o '^/usr/share/fonts/.+/fonts.dir$' |sort -u | while read -r fdir; do dir=${fdir%/fonts.dir} if [ -f "$fdir" ]; then fc-cache "$dir" ||: else rm -f -- "$no_fonts_uninstall" fi done; [ -f "$no_fonts_uninstall" ] || fc-cache --system-only ||: rm -f -- "$no_fonts_uninstall"