#!/bin/sh

# add a link if link is not already readable and the target is readable
# complain if the target is not readable

# BSln target link_name

if [ ! -r $2 ]; then
    echo ln -s $1 $2;
    if [ -r "$1" ]; then
	ln -s $1 $2;
    else
	echo "[$2] can't ln to the unreadable target '$1'" 1>&2
	exit 1
    fi
fi
