#!/bin/sh
CheckEnv() {
if [ "$SI_LOCATION" = "" ]; then
    echo "Your Account do not have SOFTIMAGE environment valiable."
    echo "What does SOFTIMAGE root path (For Example /usr/softimage)"
    read SI_LOCATION
fi

if [ -d $SI_LOCATION/3D ]; then
return
else
    while
        echo "$SI_LOCATION is invalid path. please input real path."
        read SI_LOCATION
        test ! -d $SI_LOCATION/3D
    do
        :
    done
fi
}

if test `whoami` = "root"
then
    CheckEnv

    if test -f $SI_LOCATION/3D/custom/bin/libSAA.so
    then
        rm $SI_LOCATION/3D/custom/bin/libSAA.so
    fi

    if test -f $SI_LOCATION/3D/custom/bin/libsso.so
    then
        rm $SI_LOCATION/3D/custom/bin/libsso.so
    fi

    if test -f $SI_LOCATION/3D/custom/bin/libtextool.so
    then
        rm $SI_LOCATION/3D/custom/bin/libtextool.so
    fi

    if test -f $SI_LOCATION/3D/custom/bin/libnjo.so
    then
        rm $SI_LOCATION/3D/custom/bin/libnjo.so
    fi

    if test -f $SI_LOCATION/3D/custom/bin/ninjaExport.so
    then
        rm $SI_LOCATION/3D/custom/bin/ninjaExport.so
    fi

    if test -f $SI_LOCATION/3D/custom/bin/AttrEdit.so
    then
        rm $SI_LOCATION/3D/custom/bin/AttrEdit.so
    fi

    if test -f $SI_LOCATION/3D/custom/tools/NinjaExport.cus
    then
        rm $SI_LOCATION/3D/custom/tools/NinjaExport.cus
    fi

    if test -f $SI_LOCATION/3D/custom/tools/AttrEdit.cus
    then
        rm $SI_LOCATION/3D/custom/tools/AttrEdit.cus
    fi

else
    echo You must become root, please !
fi
