#!/bin/bash
set -e

. optvars

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