Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 3b7d6f37da07f25f0003c9bf5d76eb5c > files > 11

ka-run-2.0-27mdk.src.rpm

#!/bin/bash
# Wrapper for calling rshp with the right environement
# It loads the /etc/profile.d/cluster.sh for getting the right
# environnement before calling the real rshp

PROFILE=/etc/profile.d/cluster.sh
RSHP_PATH=/usr/bin
RSHP_ARGS=""
NODES=""

if [ -f $PROFILE ]; then
	
	source $PROFILE

	if [ $1 == "-u" ]; then
		NODES=$(perl -Mcluster_set_admin -e "nka_from_urpmig($2)")
		shift;
		shift;
	else
		NODES=$(perl -Mcluster_set_admin -e "nka_from_urpmig("")")
	fi

	if [ $1 == "-v" ]; then 
		RSHP_ARGS="$RSHP_ARGS $1"
		shift;
	fi
	
	exec $RSHP_PATH/rshp_wrap $NODES $RSHP_ARGS -- $@

else
	echo "This option is only enabled on the clustering product"
	exit
fi