#!/bin/sh
set -e

. kumatux.org-vars

if [ -d $1/$2 ]
then
    PATHCONF="$KUMATUXETC/$3/`basename $1`.conf"
    LINKDIR=`$KUMATUXFIND/empty-slot.sh $4`
    ln -s $1/$2 $KUMATUXROOT/$4/$LINKDIR
    echo -n "$KUMATUXROOT/$4/$LINKDIR" >> $PATHCONF
    echo "Created $PATHCONF => `cat $PATHCONF` => $1/$2"
fi
