#!/bin/sh
# This one is Highlander's short-lived friend.

if   [ -n "$BLD_ROOT" ]; then	 ROOT="$BLD_ROOT" ;
elif [ -d /u1/olc ]; then	 ROOT="/u1/olc" ;
elif [ -d /var/local/olc ]; then ROOT="/var/local/olc" ;
elif [ -d /tmp/olc ]; then	 ROOT="/tmp/olc" ;
else				 ROOT="/tmp/olc" ; rm -f $ROOT ; mkdir $ROOT ;
fi

BLD_PTR="$ROOT/OLC.current"
if [ ! -r "$BLD_PTR" ]; then
    echo "No current build tree found!" >&2
    exit 1
fi

. $BLD_PTR
BINDIR=`/usr/athena/bin/athdir /mit/olcdev olc-test`

for prog in olcd lumberjack rpd polld olcm; do
    path="${BLD}/server/$prog/$prog"
    if [ -f "$path" ]; then
	/usr/athena/bin/install -m 755 $path $BINDIR
	echo "installing $path"
    else
	echo "$path not found!" >&2
    fi
done
