2 ################################################################################
5 # Description: Sets up a users ~/.rhosts file
6 # Author: Andrew@DeFaria.com
7 # Created: Fri Apr 30 14:13:56 PDT 1999
8 # Modifications:Thu Mar 7 11:25:36 2002: Adapted for Windows/Cygwin.
11 # (c) Copyright 2002, Andrew@DeFaria.com, all rights reserved
13 ################################################################################
14 # Set me to command name
17 # Source /etc/site_parms
18 if [ -f /etc/site_parms ]; then
21 echo "$me: WARNING: /etc/site_parms does not exist!"
25 adm_base="$SITE_TOOLS_PATH/adm"
28 adm_fpath=${adm_fpath:-$adm_base/functions}
35 error "You should not run the script as root!" 1
39 rhosts_loc=$HOME/.rhosts.loc
41 # Generate new $rhosts
43 if [ -f $rhosts_loc ]; then
44 cp $rhosts_loc $rhosts
49 # Loop through all machines in the domain and add them to the .rhosts file:
50 for machine in $(net view | grep -e "\\\\" | cut -f3 -d\\ | cut -f1 -d' ' | tr [:upper:] [:lower:]); do
51 if [ ${#machine} -lt 8 ]; then
52 echo -e "$machine\t\t$USER" >> $rhosts
54 echo -e "$machine\t$USER" >> $rhosts
58 # Insure proper permissions