#!/bin/bash source /etc/rc.d/init.d/functions LOG="/root/transition.log" BUSYBOX_FILES="$( ${LOG} for i in $(find / -xdev | sort -r) do # excludes case ${i} in /etc/ld.so.conf) continue ;; /etc/ld.so.cache) continue ;; /etc/localtime) continue ;; /etc/shadow*) continue ;; /etc/gshadow*) continue ;; /etc/passwd*) continue ;; /etc/group*) continue ;; /etc/modprobe.conf) continue ;; /etc/resolv.conf) continue ;; /etc/profile.env) continue ;; /etc/rc.d/rcboot.d*) continue ;; /etc/rc.d/rcsysinit.d*) continue ;; /etc/rc.d/rcshutdown.d*) continue ;; /etc/conf.d/net.*) continue ;; /etc/dropbear*) continue ;; /etc/alxconfig-ng*) continue ;; /usr/mage*) continue ;; /root*) continue ;; /home*) continue ;; /tmp*) continue ;; /var/db*) continue ;; /var/cache*) continue ;; /var/run*) continue ;; /var/tmp/magebuild*) continue ;; esac check_busybox ${i} && continue if [[ -z $(magequery -f ${i}) ]] then echo -e "${COLRED}NAK${COLDEFAULT} -> ${i}" #echo "not found -> ${i}" >> ${LOG} if [[ -L ${i} ]] then rm ${i} echo "==> deleted -> ${i}" >> ${LOG} elif [[ -d ${i} ]] then # only if not empty rmdir ${i} echo "==> deleted -> ${i}" >> ${LOG} else rm ${i} echo "==> deleted -> ${i}" >> ${LOG} fi else echo -e "${COLGREEN}OK${COLDEFAULT} -> ${i}" fi done # remove old cruft for i in /var/tmp/magebuild/virtual /var/run/samba do if [[ -d ${i} ]] then rm -rf ${i} echo "==> deleted -> ${i}" >> ${LOG} fi done for i in /var/run/dhcpcd-*.pid do if [[ -e ${i} ]] then rm -r ${i} echo "==> deleted -> ${i}" >> ${LOG} fi done # recreate fontconfig cache if [ -x /usr/bin/fc-cache ] then HOME=/root /usr/bin/fc-cache -sr fi