X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=clients%2FHP%2Fbin%2Fdesktopmach;fp=clients%2FHP%2Fbin%2Fdesktopmach;h=f128765c876fbe1d9b746a655018060d215c1cc1;hb=a8c84d2892f07a6863b68a11eb0a4a79ffd71fb5;hp=0000000000000000000000000000000000000000;hpb=95384f94f88aceeb5eef2d322210ba4a438b6512;p=clearscm.git diff --git a/clients/HP/bin/desktopmach b/clients/HP/bin/desktopmach new file mode 100644 index 0000000..f128765 --- /dev/null +++ b/clients/HP/bin/desktopmach @@ -0,0 +1,60 @@ +#!/bin/ksh +################################################################################ +# +# File: desktopmach +# Description: A script to execute a command on all desktop class machines +# Author: Andrew@DeFaria.com +# Created: Thu May 11 11:08:24 PDT 2000 +# Modified: +# Language: Korn Shell +# +# (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved +# +################################################################################ +# Set me to command name +me=$(basename $0) + +# Set adm_base +adm_base=${adm_base:-$HOME/adm} + +# Set adm_fpath +adm_fpath=${adm_fpath:-$adm_base/functions} + +# Source functions +. $adm_fpath/common + +# Set machines +machines=${machines:-$adm_base/data/machines} + +if [ "$1" = "-f" ]; then + shift + machines="$1" + shift +fi + +PATH=/adm/bin:$PATH + +if [ "$1" = "-r" ]; then + root=yes + shift +fi + +for desktop_machine in $(grep -ve ^# $machines | grep :Desktop: | cut -d: +-f1); do + # Execute command. Note if no command is given then the effect is to + # rlogin to each machine. + print "$desktop_machine:$@" + if [ $# -gt 0 ]; then + if [ -z "$root" ]; then + remsh $desktop_machine -n "$@" + else + root remsh $desktop_machine -n "$@" + fi + else + if [ -z "$root" ]; then + remsh $desktop_machine + else + root remsh $desktop_machine + fi + fi +done