System Administration Guide: IP Services

ProcedureHow to Specify Target Systems in a Shell Script

  1. On the system where you have configured an IPMP group, assume the Primary Administrator role or become superuser.

    The Primary Administrator role includes the Primary Administrator profile. To create the role and assign the role to a user, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Create a shell script that sets up static routes to your proposed targets.

    For example, you could create a shell script called ipmp.targets with the following contents:


    TARGETS="192.168.85.117 192.168.85.127 192.168.85.137"
    
    case "$1" in
            'start')
                /usr/bin/echo "Adding static routes for use as IPMP targets"
    		for target in $TARGETS; do
    	  /usr/sbin/route add -host $target $target
    		done
                      ;;
            'stop')
                  /usr/bin/echo "Removing static routes for use as IPMP targets"
    		 for target in $TARGETS; do
    		/usr/sbin/route delete -host $target $target
    		 done
                      ;;
      esac  
  3. Copy the shell script to the startup script directory.


     # cp ipmp.targets /etc/init.d  
    
  4. Change the permissions on the new startup script.


    # chmod 744 /etc/init.d/ipmp.targets
    
  5. Change ownership of the new startup script.


    # chown root:sys /etc/init.d/ipmp.targets
    
  6. Create a link for the startup script in the /etc/init.d directory.


    # ln /etc/init.d/ipmp.targets /etc/rc2.d/S70ipmp.targets
    

    The S70 prefix in the file name S70ipmp.targets orders the new script properly with respect to other startup scripts.