HP-UX Containers (SRP) A.03.01 Administrator's Guide
120
Appendix A: Container default route script for Serviceguard
The following script can be used by a Serviceguard package to assign a default route for an IP
address associated with a container. This script is included with the HP-UX Containers Serviceguard
Reference Implementation for containers and is installed with the HP-UX Containers product at:
/opt/hpsrp/example/serviceguard/srp_as_sg_package/srp_route_script
# Copyright (c) 2009 Hewlett-Packard Development Company L.P.
#
# This script runs the 'route' command to manage source based routing entry
# for the SRP.
#
# This script should be configured into the package configuration file
# as the first "external_script" parameter entry. It will be executed
# right after Serviceguard IP addresses assignment during package start time,
# and before removing IP addresses during package halt time.
#
# This script uses the environment variable SRP_SG_MANAGED_IP and
# SRP_SG_GATEWAY. The environment variables must be set in the
# srp_script.incl file in the same directory as this script.
#
###########################
# Source utility functions.
###########################
if [[ -z $SG_UTILS ]]
then
. /etc/cmcluster.conf
SG_UTILS=$SGCONF/scripts/mscripts/utils.sh
fi
if [[ -f ${SG_UTILS} ]]; then
. ${SG_UTILS}
if (( $? != 0 ))
then
echo "ERROR: Unable to source package utility functions file:
${SG_UTILS}"
exit 1
fi
else
echo "ERROR: Unable to find package utility functions file: ${SG_UTILS}"
exit 1
fi
###################################################################
#
# Get the environment for this package through utility function
# sg_source_pkg_env().
#
###################################################################
sg_source_pkg_env $*
###################################################################
#
# Get the SRP environment from "/etc/cmcluster/hpsrp/<srp>/srp_script.incl"
#
# Environemnt variable example: use a local gateway on the host
# SRP_SG_MANAGED_IP[0]="192.0.0.99"
# SRP_SG_GATEWAY[0]="192.0.0.99"
#
# Environemnt variable example: use a remote gateway
# SRP_SG_MANAGED_IP[1]="10.1.1.99"