Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
pvfs2-osd/examples/heartbeat/pvfs2-ha-heartbeat-configure.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
48 lines (40 sloc)
1.01 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# make sure there are at least 2 arguments | |
if [ -z "$3" ] | |
then | |
echo "Usage: `basename $0` <dir to put conf files in> <mcast addr> <sha1 key> <space seperated list of nodes>" | |
exit 1 | |
fi | |
# save name of output dir | |
OUTDIR=$1 | |
MCAST=$2 | |
SHA1=$3 | |
# setup authkeys | |
echo auth 1 > ${OUTDIR}/authkeys | |
echo 1 sha1 $SHA1 >> ${OUTDIR}/authkeys | |
# set permissions on authkeys | |
chmod 600 ${OUTDIR}/authkeys | |
if [ $? != "0" ] | |
then | |
exit 1 | |
fi | |
# put mcast information in the middle (ordering is important) | |
echo "use_logd yes" > ${OUTDIR}/ha.cf | |
echo "mcast eth0 ${MCAST} 3335 1 0" >> ${OUTDIR}/ha.cf | |
echo "auto_failback yes" >> ${OUTDIR}/ha.cf | |
echo "crm yes" >> ${OUTDIR}/ha.cf | |
echo "keepalive 1" >> ${OUTDIR}/ha.cf | |
echo "deadtime 10" >> ${OUTDIR}/ha.cf | |
echo "initdead 80" >> ${OUTDIR}/ha.cf | |
echo "compression bz2" >> ${OUTDIR}/ha.cf | |
# shift arguments down | |
shift | |
shift | |
shift | |
until [ -z "$1" ] # Until all parameters used up... | |
do | |
# append node directive to conf file | |
echo "node $1" >> ${OUTDIR}/ha.cf | |
shift | |
done | |
exit 0 |