#!/bin/sh - rsh="${RSHCMD-rsh}" rcp="${RCPCMD-rcp}" #dflthost=`hosts ppp` dflthost=aludel #dflthost=palmpre files= #'/usr/local/etc/dialins /usr/local/etc/dialins' # dailyp - routine pushed hosts home directory update and check # Steve Kinzler, kinzler@cs.indiana.edu, Oct 96/Jun 08 # http://www.cs.indiana.edu/~kinzler/home.html#homedir quiet=; bad= while : do case $# in 0) break;; *) case "$1" in -q) quiet=-e;; --) shift; break;; -h) bad=t; break;; -*) bad=t; echo "$0: unknown option ($1)" 1>&2;; *) break;; esac shift;; esac done case "$#,$bad" in *,t) cat << EOF 1>&2 usage: $0 [ -q ] [ host ... ] -q quiet mode, don't print routine reporting information Default host: $dflthost EOF exit 1;; 0,*) set x $dflthost; shift;; esac safe= (safe -d 3 /bin/csh -fc :) 2> /dev/null && safe='safe -q' for host do case "`$safe $rsh -n "$host" echo GreenIdeas`,$quiet" in GreenIdeas,?*) ;; GreenIdeas,*) echo "updating host $host ...";; *,?*) continue;; *) echo "$0: skipping $host (cannot $rsh)" 1>&2 continue;; esac hosts -l "$host" | rdisth - 2>&1 | rdistsumm $quiet rm -f core.[0-9][0-9]* 2> /dev/null $safe $rsh -n "$host" setenv HOST "$host"\; \ dailyh -d -u -l\; dailyl 2>&1 | sed "s/^/$host: /" echo "$files" | while read file pfile do case "$file" in ?*) $safe $rcp "$file" "$host:$pfile";; esac done done