#!/bin/sh -
#
# $Id: instbin,v 1.2 2002/07/09 17:48:40 dgregor Exp $
#

default_scripts="instenv instsshkey instsshconfig instprofile instbin gdf \
	worksite scpvia"

if [ $# -lt 1 ]; then
	echo "`basename $0`: invalid number of arguments" >&2
	echo "usage: `basename $0` <host> [<script>] ..." >&2
	exit 1
fi

host="$1"; shift

if [ $# -gt 0 ]; then
	scripts="$*"
else
	scripts="$default_scripts"
fi

cd $HOME/bin
if [ $? -ne 0 ]; then
	echo "`basename $0`: could not chdir to $HOME/bin.  Exiting." >&2
	exit 1
fi

ssh "$host" 'test -d $HOME/bin || mkdir -m 755 $HOME/bin'

scp -p $scripts $host:'$HOME/bin/.'
