#!/bin/sh
# Remove links of executables

SOURCE="."
DEST="/usr/local/bin"

[ "$1" ] && SOURCE=$1
[ "$2" ] && DEST=$2

if [ ! -d $SOURCE -a ! -d $DEST ]; then
   echo "Usage: $0 [source] [destination]"
   echo "Remove symbolic links of the binaries at source in the destination"
   exit 1
fi

for f in $SOURCE/*; do
  if [ -x $f ]; then
     NAME=`basename $f`
     if [ -L $DEST/$NAME ]; then
	echo Removing symbolic link $DEST/$NAME
	rm -f $DEST/$NAME
     fi  
  fi
done
