#!/bin/bash

SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BINDIR="$HOME/bin"

if [[ ! -d $BINDIR ]]; then
	mkdir $BINDIR
fi

for scripts in $SCRIPTDIR/*; do
	script=${scripts##*/}
	if [[ $script != "setup" ]] && [[ $script != "alarm.msg" ]]; then
		if [[ ! -a $BINDIR/$script ]]; then
			ln -s $SCRIPTDIR/$script $BINDIR/$script
			echo $script "symlinked to" $BINDIR/$script
		else
			echo "already exists:" $BINDIR/$script
		fi
	fi
done
