#!/bin/sh -

# Copyright (c)  1995 - 2000, The Hebrew University of Jerusalem.
# All rights reserved.
#
#	MOSIX $Id: runon.sh,v 1.2 2000/01/14 01:47:11 amnons Exp $
#
# Permission to use, copy and distribute this software is hereby granted
# under the terms of version 2 or any later version of the GNU General
# Public License, as published by the Free Software Foundation.
#
# You should have received a copy of the GNU General Public License along
# with this package; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# THE HEBREW UNIVERSITY OF JERUSALEM  PROVIDES THIS SOFTWARE IN ITS "AS IS"
# CONDITION. THE HEBREW UNIVERSITY OF JERUSALEM DISCLAIMS  ANY LIABILITY OF
# ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

# Author(s): Amnon Shiloh, Ariel Rosenblatt

usage()
{
	echo "Usage: `basename $0` MOSIX_ID [-z] command [ arg ... ]"
	exit 1
}

case "$1" in [1-9]*) where=$1 ; shift ;;
		*) usage ;;
esac

case "$1" in -z)
	zflg=-z
	shift
	case $# in 1) echo "`basename $0`: '-z' requires an argument."
		      exit 1 ;;
	esac
esac
case $#,"$1" in *,-*|0,*) usage ;; esac
exec /bin/mosrun -"$where" $zflg $*
