Foil 13 - Handling mixed remote environments (1/3)

 1 while read server client server_domain last_access password_set
 2   do
 3     ######## Is the remote system available?
 4     ping_count=`eval $ping_cmd`
 5     if [ "$ping_count" = "1" ]
 6       then
 7         ######## Select system dependent commands for the client.
 8         client_type=`$rsh_cmd ${client} "uname" < /dev/null 2>&1`
 9         if [ "$client_type" = "SunOS" ]
10           then
11             sn_ver=`$rsh_cmd ${client} "uname -r"</dev/null|cut -c1-3`
12             case "$sn_ver" in
13               5.5 )
14                 client_type=Solaris25
15               ;;
16               5* )
17                 client_type=Solaris2
18               ;;
19               4* )
20                 client_type=SunOS
21               ;;
22               * )
23                 client_type=Unknown_Sun
24                 echo "Unable to determine Sun OS type for ${client}"
25               ;;
26               esac # End of case
27           fi                                                       #13

This is the third of five slides showing the more complex, but very useful of performing operations on remote systems. The third through fifth slides expand on the previous slide to handle a complex mix of different client operating systems, applications, etc.

The third slide gets the client name, sees it is on the network, and starts determining the operating system on the remote system. This continues on the fourth slide.

  • Line 1 reads the list of client names. We don't bother to check for comments or a valid client name.
  • Line 8 gets the type of operating system on the client.
  • Lines 8-27 determine which "SunOS" we are dealing with since the old SunOS and new Solaris both say they are SunOS. This would of course need to be enhanced for new releases of Solaris.

    Previous   Next   Index