#!/bin/sh
#
#  usage:  createboot owner filename host...
#
#  Creates empty files named "filename" for later installation of x-kernels
#  by "owner".  Files are created in the root partition of each named host.
#
#  We set a protection mode of 700, but of course the owner can relax that.
#
#  This script must be run as root.
#
#  It assumes that root can successfully run rsh, and that "owner" is a known
#  login name, on each listed hosts.


if [ `whoami` != root ]
then
    echo "$0: must be run by root" 1>&2
    exit 1
fi

if [ $# -lt 3 ]
then
    echo "usage: $0 owner filename host..." 1>&2
    exit 1
fi


OWNER=$1
shift

FILE=$1
shift

set -x
for HOST
do
    rsh -n $HOST "cp /dev/null /$FILE; chown $OWNER /$FILE; chmod 700 /$FILE"
done
