#!/bin/sh # #-*- mode: Fundamental; tab-width: 4; -*- # ex:ts=4 # ### BEGIN changeable variables dirs="/bin /lib /rescue /sbin /stand /usr/bin /usr/games /usr/lib \ /usr/libdata /usr/libexec /usr/sbin /usr/share" ### if [ `id -u` != 0 ]; then echo echo "ERROR: You must be root to run $0." exit 1 fi ### Functions delete () { for moo in ${dirs}; do if [ -d ${moo} ]; then find ${moo} -ctime +1 -exec chflags noschg {} \; -delete fi done echo echo "Do not forget to re-run the installworld." } log () { if [ -f /root/delete.log ]; then rm /root/delete.log fi for moo in ${dirs}; do if [ -d ${moo} ]; then find ${moo} -ctime +1 >> /root/delete.log fi done echo echo "The log is in /root/delete.log." } usage_exit () { echo echo "Usage: $0 [-d] [-l]" echo echo " -d Delete the old files. You will need to re-run the installworld" echo " after you use this option." echo " -l Create a log to show what files that will be delete. It will" echo " not delete anything. The log file will be in /root/delete.log." exit 15 } ### ### Command line options args=`getopt dl $*` if [ $# -lt 1 ]; then usage_exit fi set -- $args for i; do case "$i" in -d) delete; shift;; -l) log; shift;; --) shift; break;; esac done ###