--- elwix/config/rc.subr 2013/01/25 15:46:24 1.3.2.1 +++ elwix/config/rc.subr 2013/05/07 20:46:48 1.6 @@ -4,7 +4,7 @@ # (C) AITNET ltd - Sofia/Bulgaria # by Michael Pounov # -# $Id: rc.subr,v 1.3.2.1 2013/01/25 15:46:24 misho Exp $ +# $Id: rc.subr,v 1.6 2013/05/07 20:46:48 misho Exp $ # ### Dont edit this file !!! @@ -94,3 +94,26 @@ CleanCVS() find $1 -type f -name .#\* -exec rm -f {} \; >/dev/null 2>&1 } +# $1 = file_pattern +# $2 = From dir +StripFiles() +{ + if [ -d "$2" ]; then + local TMPFILE=$(mktemp -q /tmp/instlist.XXXXXX) + if [ $? -ne 0 ]; then + echo "Error:: Can't create temp file, exiting..." + exit 1 + fi + + cd $2 + find . -type f -name "$1" >$TMPFILE + for i in $(cat $TMPFILE); do + if [ -x $i ]; then + echo "Strip '$i'" + strip -s $i + fi + done + cd - + rm -f $TMPFILE + fi +}