#!/bin/sh ########################################################################## # # This script is intended to be used as an example of how to start a # remote willow client on the UW's willow.u hosts and feed it a custom # configuration file. Feel free to modify this script to work on your # system. # ########################################################################## # initialize some variables confile="/dev/null" progname=`basename $0` cmdname="willow" # the default remote command to start willow xhostvar= # used by auth type xhost-xterminal if [ -z "$DISPLAY" ]; then echo "$progname: "'$DISPLAY must be set' 1>&2 ; exit 1 fi # if the display name starts with a :, then we are the console of a # unix host and we need to pre-pend the hostname to the DISPLAY setting case $DISPLAY in :*) DISPLAY=`hostname`$DISPLAY; #echo "display is $DISPLAY"; ;; *) ;; esac if [ $# -gt 1 ]; then # process command line arguments until [ "$foundarg" = "no" ] do foundarg=no case $1 in '') ;; -cf) # if there is a config file specified, keep its name and # set the default remote willow command to be one that expects # a config file to be fed to it on standard in. shift; confile="$1"; foundarg=yes; cmdname="willowcf"; shift;; *) echo "willow: unknown command line arg: $1 (giving up)" ; exit 1 ;; esac done fi # Some System V hosts have rsh as "restricted shell" and ucb rsh is remsh if [ -r /usr/bin/remsh ]; then rsh=remsh elif [ -f /usr/bin/rcmd ]; then # SCO Unix uses "rcmd" instead of rsh rsh=rcmd else rsh=rsh fi # allow the willow.u host to connect to my display # we consider this to be safe becuase there are no users on the # willow servers. /usr/bin/X11/xhost + willow.u.washington.edu > /dev/null # run the remote willow command and feed it any config file # data that was specified. If no config file, just run the # standard willow command with /dev/null as input. exec cat $confile | $rsh willow.u.washington.edu -l $cmdname $DISPLAY