#!/bin/sh

. optvars

APPDIR=`basename $1`

for DIR in $KUMATUXETCDIRSNOTHIRD
do
    if [ -e $KUMATUXETC/$DIR/$APPDIR.conf ]
    then
        rm -v $KUMATUXETC/$DIR/$APPDIR.conf
    fi
done

for DIR in $KUMATUXPYTHONVERSIONS
do
    if [ -e $KUMATUXETC/$KUMATUXETCPYTHON/$DIR/$APPDIR.conf ]
    then
        rm -v $KUMATUXETC/$KUMATUXETCPYTHON/$DIR/$APPDIR.conf
    fi
done

for LINKDIR in $KUMATUXROOTDIRS
do
    for FILE in `ls -l /$LINKDIR/ | grep $APPDIR | sed 's/ -> .*//' | sed 's/.* //'`
    do
	rm /$LINKDIR/$FILE
    done
done
