#!/bin/sh
set -e

. $KUMATUXBIN/kumatux.org-vars

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