#!/bin/sh -u # # $0 userid # # Wait until userid signs on, then print a message and exit. # The script also exits if $USER is not currently signed on. # This could be run in the background. # # -IAN! idallen@ncf.ca July 2001 export PATH=/bin:/usr/bin umask 022 case "$#" in 0) echo 1>&2 "$0: No arguments; nothing done" exit 1 ;; 1) ;; *) echo 1>&2 "$0: Expecting 1 userid arg; found $# ($*)" exit 1 ;; esac # Keep looking for $1 as long as $USER is still signed on. # while ! who | grep "$1" ; do sleep 30 if ! who | grep "$USER" >/dev/null ; then echo 1>&2 "$0: Userid $USER is no longer signed on." exit 1 fi done echo "$0: Userid $1 is now signed on." exit 0