Just realized I screwed up the last patch. Attached is a corrected patch. The part that was changed in the patch is for heartbeat-2.1.4/resources/OCF/SysInfo line 124
-- Regards, Andres
diff -urN heartbeat-2.1.4.old/bootstrap heartbeat-2.1.4/bootstrap
--- heartbeat-2.1.4.old/bootstrap 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/bootstrap 2008-11-30 14:04:42.000000000 -0500
@@ -233,7 +233,7 @@
LT_minnum=`echo "$LT_minvers" | sed -e 's%[^0-9].*%%'`
if
- [ $LT_majvers -lt 1 ] || [ $LT_majvers = 1 -a $LT_minnum -lt 4 ]
+ [ $LT_majvers -lt 1 ] || $( [ $LT_majvers = 1 ] && [ $LT_minnum -lt 4 ] )
then
echo "Minimum version of libtool is 1.4. You have $LT_version installed."
exit 1
diff -urN heartbeat-2.1.4.old/cim/mof/do_register.sh heartbeat-2.1.4/cim/mof/do_register.sh
--- heartbeat-2.1.4.old/cim/mof/do_register.sh 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/cim/mof/do_register.sh 2008-11-30 21:07:59.000000000 -0500
@@ -309,10 +309,10 @@
usage () {
echo "usage: $0 [-t cimserver] [-u] -r regfile -m mof"
- echo $'\t'-t cimserver: specify cimserver "[pegasus|openwbem|sfcb]".
- echo $'\t'-u: Unregister
- echo $'\t'-r regfile: specify reg file.
- echo $'\t'-m moffile: specify mof file.
+ printf "\t-t cimserver: specify cimserver [pegasus|openwbem|sfcb].\n"
+ printf "\t-u: Unregister.\n"
+ printf "\t-r regfile: specify reg file.\n"
+ printf "\t-m moffile: specify mof file.\n"
exit 0
}
diff -urN heartbeat-2.1.4.old/ConfigureMe heartbeat-2.1.4/ConfigureMe
--- heartbeat-2.1.4.old/ConfigureMe 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/ConfigureMe 2008-11-30 13:35:39.000000000 -0500
@@ -61,13 +61,13 @@
ConfigureLinux() {
DFLAGS=""
if
- [ -f /etc/UnitedLinux-release -a -s /etc/UnitedLinux-release ]
+ [ -f /etc/UnitedLinux-release ] && [ -s /etc/UnitedLinux-release ]
then
distro="United Linux"
PACKAGECMD="$MAKE_CMD rpm"
DFLAGS="--with-ucd-snmp-devel=ucdsnmp --with-group-id=90 --with-ccmuser-id=90"
elif
- [ -f /etc/SuSE-release -a -s /etc/SuSE-release ]
+ [ -f /etc/SuSE-release ] && [ -s /etc/SuSE-release ]
then
distro="SuSE Linux"
PACKAGECMD="$MAKE_CMD rpm"
@@ -81,25 +81,25 @@
[78].*) DFLAGS="$DFLAGS --mandir=/usr/share/man --disable-snmp-subagent --disable-swig --with-ucd-snmp-devel=ucdsnmp";;
esac
elif
- [ -f /etc/redhat-release -a -s /etc/redhat-release ]
+ [ -f /etc/redhat-release ] && [ -s /etc/redhat-release ]
then
distro="RedHat Linux"
PACKAGECMD="$MAKE_CMD rpm"
DFLAGS="--mandir=/usr/share/man"
elif
- [ -f /etc/conectiva-release -a -s /etc/conectiva-release ]
+ [ -f /etc/conectiva-release ] && [ -s /etc/conectiva-release ]
then
distro="Conectiva Linux"
PACKAGECMD="$MAKE_CMD rpm"
DFLAGS="--with-group-id=17 --mandir=/usr/share/man --infodir=/usr/share/info --with-ccmuser-id=17"
elif
- [ -f /etc/debian_version -a -s /etc/debian_version ]
+ [ -f /etc/debian_version ] && [ -s /etc/debian_version ]
then
distro="Debian GNU/Linux"
PACKAGECMD="$MAKE_CMD deb"
DFLAGS="--mandir=/usr/share/man"
elif
- [ -f /etc/gentoo-release -a -s /etc/gentoo-release ]
+ [ -f /etc/gentoo-release ] && [ -s /etc/gentoo-release ]
then
distro="Gentoo Linux"
PACKAGECMD="$MAKE_CMD dist"
@@ -295,7 +295,7 @@
;;
distcheck)
do_configure $FLAGS $@ && \
- source ./heartbeat/lib/ha_config && \
+ . ./heartbeat/lib/ha_config && \
Run $MAKE_CMD DESTDIR="$PWD/heartbeat-$VERSION/=inst" distcheck
;;
pkg|package|rpm|deb|dpkg)
diff -urN heartbeat-2.1.4.old/cts/getpeinputs.sh.in heartbeat-2.1.4/cts/getpeinputs.sh.in
--- heartbeat-2.1.4.old/cts/getpeinputs.sh.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/cts/getpeinputs.sh.in 2008-11-30 14:02:19.000000000 -0500
@@ -79,7 +79,7 @@
printf("testnum=%d\n",testnum);
}
'`
-test -z "$testnum" -o $testnum -lt 0 && {
+$( [ -z "$testnum" ] || [ $testnum -lt 0 ] ) && {
echo "sorry, could not get the test number"
exit
}
@@ -87,7 +87,7 @@
echo "sorry, could not get node names"
exit
}
-test "$starttime" -a "$endtime" || {
+$( [ "$starttime" ] && [ "$endtime" ] ) || {
echo "sorry, could not get all timestamps"
exit
}
diff -urN heartbeat-2.1.4.old/heartbeat/init.d/heartbeat.in heartbeat-2.1.4/heartbeat/init.d/heartbeat.in
--- heartbeat-2.1.4.old/heartbeat/init.d/heartbeat.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/heartbeat/init.d/heartbeat.in 2008-11-30 13:40:00.000000000 -0500
@@ -190,7 +190,7 @@
init_watchdog() {
if
- [ -f /proc/devices -a -x $MODPROBE ]
+ [ -f /proc/devices ] && [ -x $MODPROBE ]
then
init_watchdog_linux
fi
@@ -252,7 +252,7 @@
fi;;
esac
if
- [ "X$WATCHDEV" != X -a ! -c "$WATCHDEV" -a $insmod = yes ]
+ [ "X$WATCHDEV" != X ] && [ ! -c "$WATCHDEV" ] && [ $insmod = yes ]
then
minor=`cat /proc/misc | grep watchdog | cut -c1-4`
mknod -m 600 $WATCHDEV c $MISCDEV $minor
@@ -305,7 +305,7 @@
chmod -R 750 $RUNDIR/heartbeat
fi
if
- [ -f $HA_DIR/ipresources -a ! -f $HA_DIR/haresources ]
+ [ -f $HA_DIR/ipresources ] && [ ! -f $HA_DIR/haresources ]
then
mv $HA_DIR/ipresources $HA_DIR/haresources
fi
diff -urN heartbeat-2.1.4.old/heartbeat/lib/BasicSanityCheck.in heartbeat-2.1.4/heartbeat/lib/BasicSanityCheck.in
--- heartbeat-2.1.4.old/heartbeat/lib/BasicSanityCheck.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/heartbeat/lib/BasicSanityCheck.in 2008-11-30 13:46:59.000000000 -0500
@@ -413,7 +413,7 @@
max=$2
fi
if
- [ $count -lt $min -o $count -gt $max ]
+ [ $count -lt $min ] || [ $count -gt $max ]
then
echo "ERROR: Did not find [$2:$3] occurances of $1 in $LOGFILE `date`" 2>&1 | tee -a $LOGFILE
echo "ERROR: Found $count instead." | tee -a $LOGFILE
diff -urN heartbeat-2.1.4.old/heartbeat/lib/ResourceManager.in heartbeat-2.1.4/heartbeat/lib/ResourceManager.in
--- heartbeat-2.1.4.old/heartbeat/lib/ResourceManager.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/heartbeat/lib/ResourceManager.in 2008-11-30 13:56:30.000000000 -0500
@@ -176,7 +176,7 @@
for dir in $HA_RESOURCEDIR $INITDIR
do
if
- [ -f $dir/$script -a -x $dir/$script ]
+ [ -f $dir/$script ] && [ -x $dir/$script ]
then
echo $dir/$script;
return 0;
@@ -218,7 +218,7 @@
spath=`scriptpath $script`
if
- [ -f "$spath" -a -x "$spath" ]
+ [ -f "$spath" ] && [ -x "$spath" ]
then
ha_log "info: Running $spath $arg $2"
ha_debug "debug: Starting $spath $arg $2"
@@ -248,7 +248,7 @@
while
doscript $j stop >>$HA_DEBUGLOG 2>&1
rc1=$?
- [ $HA_STOPRETRYMAX -le 0 -o $retries -lt $HA_STOPRETRYMAX ] &&
+ $( [ $HA_STOPRETRYMAX -le 0 ] || [ $retries -lt $HA_STOPRETRYMAX ] ) &&
[ $rc1 -ne 0 ]
do
sleep 1
diff -urN heartbeat-2.1.4.old/ldirectord/init.d/ldirectord.in heartbeat-2.1.4/ldirectord/init.d/ldirectord.in
--- heartbeat-2.1.4.old/ldirectord/init.d/ldirectord.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/ldirectord/init.d/ldirectord.in 2008-11-30 21:05:02.000000000 -0500
@@ -42,7 +42,7 @@
[ -x $DAEMON ] || exit 0
action() {
- echo -n "$1... "
+ printf "$1... "
shift
$@
stat=$?
diff -urN heartbeat-2.1.4.old/lib/plugins/stonith/external/ibmrsa.in heartbeat-2.1.4/lib/plugins/stonith/external/ibmrsa.in
--- heartbeat-2.1.4.old/lib/plugins/stonith/external/ibmrsa.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/lib/plugins/stonith/external/ibmrsa.in 2008-11-30 21:10:35.000000000 -0500
@@ -39,7 +39,7 @@
echo "IBM mpcli not installed"
return 1
}
- if [ x = "x$ipaddr" -o x = "x$userid" -o x = "x$passwd" ]
+ if [ x = "x$ipaddr" ] || [ x = "x$userid" ] || [ x = "x$passwd" ]
then
echo "ipaddr, userid, or passwd missing; check configuration"
return 1
@@ -56,7 +56,7 @@
) | /opt/IBMmpcli/bin/MPCLI.sh | grep -w $goodstg >/dev/null 2>&1
rc=$?
grep -w $failstg $outf
- test $rc -eq 0 -a $? -eq 1
+ [ $rc -eq 0 ] && [ $? -eq 1 ]
}
ibmrsa_reboot() {
echo restart -now | mpcli
diff -urN heartbeat-2.1.4.old/lib/plugins/stonith/external/ipmi heartbeat-2.1.4/lib/plugins/stonith/external/ipmi
--- heartbeat-2.1.4.old/lib/plugins/stonith/external/ipmi 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/lib/plugins/stonith/external/ipmi 2008-11-30 21:11:05.000000000 -0500
@@ -44,7 +44,7 @@
echo "ipmitool not installed"
return 1
}
- if [ -z "${ipaddr}" -o -z "${userid}" -o -z "${passwd}" ]; then
+ if [ -z "${ipaddr}" ] || [ -z "${userid}" ] || [ -z "${passwd}" ]; then
echo "ipaddr, userid or password missing; check configuration"
return 1
fi
diff -urN heartbeat-2.1.4.old/lrm/test/lrmregtest.in heartbeat-2.1.4/lrm/test/lrmregtest.in
--- heartbeat-2.1.4.old/lrm/test/lrmregtest.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/lrm/test/lrmregtest.in 2008-11-30 14:37:00.000000000 -0500
@@ -9,7 +9,7 @@
# Copyright (c) 2007 SUSE LINUX AG, Dejan Muhamedagic
# All Rights Reserved.
#
-# Copyright (c) 2004 SUSE LINUX AG, Lars Marowsky-Br�e
+# Copyright (c) 2004 SUSE LINUX AG, Lars Marowsky-Br�e
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
@@ -172,7 +172,7 @@
`
check4parallel() {
- if [ -f "$lockf" ] && kill -0 `cat $lockf` 2>/dev/null
+ if [ -f "$lockf" ] && kill -0 `cat $lockf` >/dev/null 2>&1
then
ocf_log err "There is another instance of ${OCF_RESOURCE_INSTANCE} running: pid `cat $lockf`."
exit $OCF_ERR_GENERIC
diff -urN heartbeat-2.1.4.old/lrm/test/regression.sh.in heartbeat-2.1.4/lrm/test/regression.sh.in
--- heartbeat-2.1.4.old/lrm/test/regression.sh.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/lrm/test/regression.sh.in 2008-11-30 14:42:46.000000000 -0500
@@ -239,7 +239,7 @@
[ $# -eq 0 ] && set "set:$DFLT_TESTSET"
for a; do
- if [ "$a" -a -f "$TESTDIR/$a" ]; then
+ if [ "$a" ] && [ -f "$TESTDIR/$a" ]; then
testcase=$a
runtestcase
else
diff -urN heartbeat-2.1.4.old/resources/heartbeat/LVSSyncDaemonSwap.in heartbeat-2.1.4/resources/heartbeat/LVSSyncDaemonSwap.in
--- heartbeat-2.1.4.old/resources/heartbeat/LVSSyncDaemonSwap.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/heartbeat/LVSSyncDaemonSwap.in 2008-11-30 14:57:51.000000000 -0500
@@ -154,7 +154,7 @@
}
usage() {
- echo -e $USAGE >&2
+ printf "$USAGE\n" >&2
}
if
diff -urN heartbeat-2.1.4.old/resources/heartbeat/OCF.in heartbeat-2.1.4/resources/heartbeat/OCF.in
--- heartbeat-2.1.4.old/resources/heartbeat/OCF.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/heartbeat/OCF.in 2008-11-30 14:52:46.000000000 -0500
@@ -139,8 +139,8 @@
if
- [ ! -f "$Resource_Script" -o ! -x "$Resource_Script" \
- ! -f "$Resource_Inst_File" ]
+ [ ! -f "$Resource_Script" ] || [ ! -x "$Resource_Script" ] ||
+ [ ! -f "$Resource_Inst_File" ]
then
usage
fi
diff -urN heartbeat-2.1.4.old/resources/OCF/apache heartbeat-2.1.4/resources/OCF/apache
--- heartbeat-2.1.4.old/resources/OCF/apache 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/apache 2008-11-30 20:29:20.000000000 -0500
@@ -275,7 +275,7 @@
ApachePID=$1
# Use /proc if it looks like it's here...
if
- [ -d /proc -a -d /proc/1 ]
+ [ -d /proc ] && [ -d /proc/1 ]
then
[ -d /proc/$ApachePID ]
else
@@ -543,7 +543,7 @@
LSB_STATUS_STOPPED=3
if
- [ "X$HTTPD" = X -o ! -f "$HTTPD" -o ! -x "$HTTPD" ]
+ [ "X$HTTPD" = X ] || [ ! -f "$HTTPD" ] || [ ! -x "$HTTPD" ]
then
case $0 in
*IBM*) HTTPD=$IBMHTTPD
@@ -553,7 +553,7 @@
for h in $HTTPDLIST
do
if
- [ -f $h -a -x $h ]
+ [ -f $h ] && [ -x $h ]
then
HTTPD=$h
break
diff -urN heartbeat-2.1.4.old/resources/OCF/AudibleAlarm heartbeat-2.1.4/resources/OCF/AudibleAlarm
--- heartbeat-2.1.4.old/resources/OCF/AudibleAlarm 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/AudibleAlarm 2008-11-30 20:56:52.000000000 -0500
@@ -80,7 +80,7 @@
# Use () to create a subshell to make the redirection be synchronized.
( while [ 1 ]; do
sleep 1 #Sleep first, incase we bail out
- echo -ne "\a" > /dev/console
+ printf "\a" >/dev/console
# Uncomment this line to cause floppy drive light
# to flash (requires fdutils package).
# /usr/bin/floppycontrol --pollstate > /dev/null
diff -urN heartbeat-2.1.4.old/resources/OCF/db2 heartbeat-2.1.4/resources/OCF/db2
--- heartbeat-2.1.4.old/resources/OCF/db2 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/db2 2008-11-30 21:03:30.000000000 -0500
@@ -125,8 +125,8 @@
# Let's make sure a few important things are there...
if
- [ -d "$db2sql" -a -d "$db2bin" -a -f "$db2profile" -a \
- -x "$db2profile" -a -x "$db2db2" ]
+ [ -d "$db2sql" ] && [ -d "$db2bin" ] && [ -f "$db2profile" ] && \
+ [ -x "$db2profile" ] && [ -x "$db2db2" ]
then
db2instance=`runasdb2 'echo $DB2INSTANCE'`
test ! -z "$db2instance"
@@ -329,7 +329,7 @@
US=`id -u -n`
US=`echo $US`
if
- [ $US != root -a $US != $db2admin ]
+ [ $US != root ] && [ $US != $db2admin ]
then
ocf_log err "$0 must be run as root or $db2admin"
exit $OCF_ERR_PERM
diff -urN heartbeat-2.1.4.old/resources/OCF/drbd heartbeat-2.1.4/resources/OCF/drbd
--- heartbeat-2.1.4.old/resources/OCF/drbd 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/drbd 2008-11-30 16:54:17.000000000 -0500
@@ -267,7 +267,7 @@
: OK
else
do_cmd modprobe -s drbd `$DRBDADM sh-mod-parms` || {
- ocf_log err "Cannot load the drbd module."$'\n';
+ ocf_log err $(printf "Cannot load the drbd module.\n");
return $OCF_ERR_GENERIC
}
ocf_log debug "$RESOURCE start: Module loaded."
diff -urN heartbeat-2.1.4.old/resources/OCF/eDir88 heartbeat-2.1.4/resources/OCF/eDir88
--- heartbeat-2.1.4.old/resources/OCF/eDir88 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/eDir88 2008-11-30 21:41:11.000000000 -0500
@@ -186,7 +186,7 @@
# Startup time can be in excess of 10 minutes.
# Leave a very long heartbeat timeout on the start action
# We're relying on heartbeat to bail us out...
- let CNT=$CNT+1
+ CNT=$((CNT+1))
ocf_log info "eDirectory start waiting for ${CNT}th retry for $NDSCONF."
sleep 10
done
@@ -318,7 +318,7 @@
eDir_validate() {
- declare rc=$OCF_SUCCESS
+ local rc=$OCF_SUCCESS
# Script must be run as root
if ! ocf_is_root ; then
diff -urN heartbeat-2.1.4.old/resources/OCF/ids heartbeat-2.1.4/resources/OCF/ids
--- heartbeat-2.1.4.old/resources/OCF/ids 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/ids 2008-11-30 17:08:47.000000000 -0500
@@ -233,8 +233,8 @@
# Only continue if the two expected parameters
# are not empty and "idsdebug" is set to "true"
# or the message is of type "error".
- if [ $# -eq 2 -a -n "$1" -a -n "$2" ]; then
- if [ "$idsdebug" = "true" -o "$1" = "error" ]; then
+ if [ $# -eq 2 ] && [ -n "$1" ] && [ -n "$2" ]; then
+ if [ "$idsdebug" = "true" ] || [ "$1" = "error" ]; then
case $idslogger in
# Print messages to stdout via echo command.
echo)
@@ -302,7 +302,7 @@
# have been passed or set and validate them.
# OCF vars not passed, vars empty - set and export them to the shell environment.
- if [ -n "$OCF_RESKEY_informixdir" -a -n "$OCF_RESKEY_informixserver" -a -n "$OCF_RESKEY_onconfig" ]; then
+ if [ -n "$OCF_RESKEY_informixdir" ] && [ -n "$OCF_RESKEY_informixserver" ] && [ -n "$OCF_RESKEY_onconfig" ]; then
ids_log info "ids_validate: passed vars not empty"
INFORMIXDIR=$OCF_RESKEY_informixdir
@@ -316,7 +316,7 @@
fi
# Check if INFORMIXDIR is non-empty and a directory (and if there was an error so far).
- if [ $rc -eq $OCF_SUCCESS -a -n "$INFORMIXDIR" -a -d "$INFORMIXDIR" ]; then
+ if [ $rc -eq $OCF_SUCCESS ] && [ -n "$INFORMIXDIR" ] && [ -d "$INFORMIXDIR" ]; then
ids_log info "ids_validate: INFORMIXDIR is valid: $INFORMIXDIR"
rc=$OCF_SUCCESS
else
@@ -325,7 +325,7 @@
fi
# Check if INFORMIXSERVER is non-empty (and if there was an error so far).
- if [ $rc -eq $OCF_SUCCESS -a -n "$INFORMIXSERVER" ]; then
+ if [ $rc -eq $OCF_SUCCESS ] && [ -n "$INFORMIXSERVER" ]; then
ids_log info "ids_validate: INFORMIXSERVER is valid: $INFORMIXSERVER"
rc=$OCF_SUCCESS
else
@@ -334,17 +334,17 @@
fi
# Check if ONCONFIG is non-empty and a non-empty file (and if there was an error so far).
- if [ $rc -eq $OCF_SUCCESS -a -n "$ONCONFIG" -a -s "$INFORMIXDIR/etc/$ONCONFIG" ]; then
+ if [ $rc -eq $OCF_SUCCESS ] && [ -n "$ONCONFIG" ] && [ -s "$INFORMIXDIR/etc/$ONCONFIG" ]; then
ids_log info "ids_validate: ONCONFIG is a non-empty file in: \$INFORMIXDIR/etc/\$ONCONFIG where ONCONFIG=$ONCONFIG"
rc=$OCF_SUCCESS
else
- if [ -z "$ONCONFIG" -a -s "$INFORMIXDIR/etc/onconfig" ]; then
+ if [ -z "$ONCONFIG" ] && [ -s "$INFORMIXDIR/etc/onconfig" ]; then
ONCONFIG="onconfig"
export ONCONFIG
ids_log info "ids_validate: ONCONFIG is a non-empty file in: \$INFORMIXDIR/etc/\$ONCONFIG where ONCONFIG=$ONCONFIG"
rc=$OCF_SUCCESS
else
- if [ -z "$ONCONFIG" -a -s "$INFORMIXDIR/etc/onconfig.std" ]; then
+ if [ -z "$ONCONFIG" ] && [ -s "$INFORMIXDIR/etc/onconfig.std" ]; then
ONCONFIG="onconfig.std"
export ONCONFIG
ids_log info "ids_validate: ONCONFIG is a non-empty file in: \$INFORMIXDIR/etc/\$ONCONFIG where ONCONFIG=$ONCONFIG"
@@ -358,7 +358,7 @@
# Check if the commands oninit, onstat, onmode and dbaccess exist in INFORMIXDIR/bin/
# and whether they are executable (do this only if there wasn't an error so far).
- if [ $rc -eq $OCF_SUCCESS -a -x "$INFORMIXDIR/bin/oninit" -a -x "$INFORMIXDIR/bin/onstat" -a -x "$INFORMIXDIR/bin/onmode" -a -x "$INFORMIXDIR/bin/dbaccess" ]; then
+ if [ $rc -eq $OCF_SUCCESS ] && [ -x "$INFORMIXDIR/bin/oninit" ] && [ -x "$INFORMIXDIR/bin/onstat" ] && [ -x "$INFORMIXDIR/bin/onmode" ] && [ -x "$INFORMIXDIR/bin/dbaccess" ]; then
ids_log info "ids_validate: oninit, onstat and dbaccess exist and are executable in: \$INFORMIXDIR/bin/"
rc=$OCF_SUCCESS
else
@@ -372,7 +372,7 @@
echo $PATH | grep $INFORMIXDIR > /dev/null 2>&1
inpath=$?
- if [ $rc -eq $OCF_SUCCESS -a $inpath -ne 0 ]; then
+ if [ $rc -eq $OCF_SUCCESS ] && [ $inpath -ne 0 ]; then
PATH="${INFORMIXDIR}/bin":${PATH}
export PATH
ids_log info "ids_validate: PATH did not contain INFORMIXDIR, added \$INFORMIXDIR/bin"
@@ -383,7 +383,7 @@
echo $LD_LIBRARY_PATH | grep $INFORMIXDIR > /dev/null 2>&1
inldlibpath=$?
- if [ $rc -eq $OCF_SUCCESS -a $inldlibpath -ne 0 ]; then
+ if [ $rc -eq $OCF_SUCCESS ] && [ $inldlibpath -ne 0 ]; then
LD_LIBRARY_PATH="${INFORMIXDIR}/lib:${INFORMIXDIR}/lib/esql"
export LD_LIBRARY_PATH
ids_log info "ids_validate: LD_LIBRARY_PATH did not contain INFORMIXDIR, added \$INFORMIXDIR/lib and \$INFORMIXDIR/lib/esql, added them"
@@ -393,7 +393,7 @@
# Check if dbname is empty (and if there was an error so far)
# if it is empty, assign default.
- if [ $rc -eq $OCF_SUCCESS -a -n "$OCF_RESKEY_dbname" ]; then
+ if [ $rc -eq $OCF_SUCCESS ] && [ -n "$OCF_RESKEY_dbname" ]; then
ids_log info "ids_validate: dbname is valid: $OCF_RESKEY_dbname"
rc=$OCF_SUCCESS
else
@@ -406,7 +406,7 @@
# Check if sqltestquery is empty (and if there was an error so far)
# if it is empty, assign default.
- if [ $rc -eq $OCF_SUCCESS -a -n "$OCF_RESKEY_sqltestquery" ]; then
+ if [ $rc -eq $OCF_SUCCESS ] && [ -n "$OCF_RESKEY_sqltestquery" ]; then
ids_log info "ids_validate: sqltestquery is valid: $OCF_RESKEY_sqltestquery"
rc=$OCF_SUCCESS
else
diff -urN heartbeat-2.1.4.old/resources/OCF/IPaddr heartbeat-2.1.4/resources/OCF/IPaddr
--- heartbeat-2.1.4.old/resources/OCF/IPaddr 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/IPaddr 2008-11-30 20:59:41.000000000 -0500
@@ -599,7 +599,7 @@
# The address is active, now notify others about it using sendarp
- if [ "$SYSTYPE" = "DarwinBSD" -a "$NIC_unique" = "lo0" ]; then
+ if [ "$SYSTYPE" = "DarwinBSD" ] && [ "$NIC_unique" = "lo0" ]; then
# Darwin can't send ARPs on loopback devices
SENDARP=""
fi
@@ -668,7 +668,7 @@
ip_status_internal
rc=$?
- if [ $OCF_CHECK_LEVEL = 0 -o $rc != 0 ]; then
+ if [ $OCF_CHECK_LEVEL = 0 ] || [ $rc != 0 ]; then
return $rc
fi
@@ -726,7 +726,7 @@
fi
: ${OCF_RESKEY_lvs_support=0}
- if [ "$SYSTYPE" = "Linux" -o "$SYSTYPE" = "SunOS" ]; then
+ if [ "$SYSTYPE" = "Linux" ] || [ "$SYSTYPE" = "SunOS" ]; then
:
else
if [ "${OCF_RESKEY_lvs_support}" = "1" ]; then
@@ -809,10 +809,10 @@
: ${OCF_RESKEY_lvs_support=0}
# Normalize the value of lvs_support
-if [ "${OCF_RESKEY_lvs_support}" = "true" \
- -o "${OCF_RESKEY_lvs_support}" = "on" \
- -o "${OCF_RESKEY_lvs_support}" = "yes" \
- -o "${OCF_RESKEY_lvs_support}" = "1" ]; then
+if [ "${OCF_RESKEY_lvs_support}" = "true" ] \
+ || [ "${OCF_RESKEY_lvs_support}" = "on" ] \
+ || [ "${OCF_RESKEY_lvs_support}" = "yes" ] \
+ || [ "${OCF_RESKEY_lvs_support}" = "1" ]; then
OCF_RESKEY_lvs_support=1
else
OCF_RESKEY_lvs_support=0
diff -urN heartbeat-2.1.4.old/resources/OCF/IPaddr2 heartbeat-2.1.4/resources/OCF/IPaddr2
--- heartbeat-2.1.4.old/resources/OCF/IPaddr2 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/IPaddr2 2008-11-30 21:02:25.000000000 -0500
@@ -5,13 +5,13 @@
# OCF Resource Agent compliant IPaddr2 script.
#
# Based on work by Tuomo Soini, ported to the OCF RA API by Lars
-# Marowsky-Br�e. Implements Cluster Alias IP functionality too.
+# Marowsky-Br�e. Implements Cluster Alias IP functionality too.
#
# Cluster Alias IP cleanup, fixes and testing by Michael Schwartzkopff
#
#
# Copyright (c) 2003 Tuomo Soini
-# Copyright (c) 2004-2006 SUSE LINUX AG, Lars Marowsky-Br�e
+# Copyright (c) 2004-2006 SUSE LINUX AG, Lars Marowsky-Br�e
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
@@ -388,7 +388,7 @@
ocf_log info "$CMD"
ADDR=`$CMD`
- if [ $? -ne 0 -o ! -z "$ADDR" ]; then
+ if [ $? -ne 0 ] || [ ! -z "$ADDR" ]; then
return $?
fi
diff -urN heartbeat-2.1.4.old/resources/OCF/iscsi heartbeat-2.1.4/resources/OCF/iscsi
--- heartbeat-2.1.4.old/resources/OCF/iscsi 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/iscsi 2008-11-30 20:49:47.000000000 -0500
@@ -179,7 +179,7 @@
open_iscsi_discovery() {
output=`$iscsiadm -m discovery -p $OCF_RESKEY_portal -t $discovery_type`
- if [ $? -ne 0 -o x = "x$output" ]; then
+ if [ $? -ne 0 ] || [ x = "x$output" ]; then
[ x != "x$output" ] && echo "$output"
return 3
fi
diff -urN heartbeat-2.1.4.old/resources/OCF/ManageRAID heartbeat-2.1.4/resources/OCF/ManageRAID
--- heartbeat-2.1.4.old/resources/OCF/ManageRAID 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/ManageRAID 2008-11-30 16:55:07.000000000 -0500
@@ -64,7 +64,7 @@
#
check_file ()
{
- if [[ ! -e $1 ]]; then
+ if [ ! -e $1 ]; then
ocf_log err "setup problem: file $1 does not exist."
exit $OCF_ERR_GENERIC
fi
diff -urN heartbeat-2.1.4.old/resources/OCF/mysql heartbeat-2.1.4/resources/OCF/mysql
--- heartbeat-2.1.4.old/resources/OCF/mysql 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/mysql 2008-11-30 20:55:35.000000000 -0500
@@ -276,8 +276,8 @@
fi
pid=`cat $OCF_RESKEY_pid`;
- if [ -d /proc -a -d /proc/1 ]; then
- [ "u$pid" != "u" -a -d /proc/$pid ]
+ if [ -d /proc ] && [ -d /proc/1 ]; then
+ [ "u$pid" != "u" ] && [ -d /proc/$pid ]
else
kill -0 $pid >/dev/null 2>&1
fi
@@ -295,7 +295,7 @@
mysql_status
rc=$?
- if [ $OCF_CHECK_LEVEL = 0 -o $rc != 0 ]; then
+ if [ $OCF_CHECK_LEVEL = 0 ] || [ $rc != 0 ]; then
return $rc
fi
@@ -324,7 +324,7 @@
chmod 0640 $OCF_RESKEY_log
[ -x /sbin/restorecon ] && /sbin/restorecon $OCF_RESKEY_log
- if [ "$OCF_RESKEY_enable_creation" = 1 -a ! -d $OCF_RESKEY_datadir/mysql] ; then
+ if [ "$OCF_RESKEY_enable_creation" = 1 ] && [ ! -d $OCF_RESKEY_datadir/mysql] ; then
ocf_log info "Initializing MySQL database: "
$MYSQL_BINDIR/mysql_install_db --datadir=$OCF_RESKEY_datadir
rc=$?
diff -urN heartbeat-2.1.4.old/resources/OCF/oracle heartbeat-2.1.4/resources/OCF/oracle
--- heartbeat-2.1.4.old/resources/OCF/oracle 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/oracle 2008-11-30 22:34:21.000000000 -0500
@@ -229,10 +229,10 @@
testoraenv() {
# Let's make sure a few important things are set...
- [ x != "x$ORACLE_HOME" -a x != "x$ORACLE_OWNER" ] ||
+ [ x != "x$ORACLE_HOME" ] && [ x != "x$ORACLE_OWNER" ] ||
return 1
# and some important things are there
- [ -x "$sqlplus" -a -x "$lsnrctl" -a -x "$tnsping" ] ||
+ [ -x "$sqlplus" ] && [ -x "$lsnrctl" ] && [ -x "$tnsping" ] ||
return 1
return 0
}
@@ -261,7 +261,6 @@
# Run commands in the oracle admin sqlplus...
#
dbasql() {
- typeset func
(
echo "connect / as sysdba"
echo "set feedback off"
@@ -317,12 +316,12 @@
[ x"${clear_backupmode}" = x"true" ]
}
is_instance_in_backup_mode() {
- typeset count
+ local count
count="`dbasql db_backup_mode | sed 's/COUNT//'`"
[ x"$count" != x"0" ]
}
clear_backup_mode() {
- typeset output
+ local output
output="`dbasql dbendbackup`"
ocf_log info "Oracle instance $ORACLE_SID alter database end backup: $output"
}
@@ -341,17 +340,17 @@
# Part 1: Oracle
dumpinstipc() {
- typeset dumpdest=`dbasql getdumpdest`
- [ "x$dumpdest" != x -a -d "$dumpdest" ] || return 1
- typeset -i fcount=`ls -rt $dumpdest | wc -l`
+ local dumpdest=`dbasql getdumpdest`
+ $( [ "x$dumpdest" != x ] && [ -d "$dumpdest" ] ) || return 1
+ local fcount=`ls -rt $dumpdest | wc -l`
dbasql getipc >/dev/null 2>&1
- typeset lastf=`ls -rt $dumpdest | grep -v '^\.*$' | tail -1`
- typeset -i fcount2=`ls -rt $dumpdest | wc -l`
+ local lastf=`ls -rt $dumpdest | grep -v '^\.*$' | tail -1`
+ local fcount2=`ls -rt $dumpdest | wc -l`
[ $((fcount+1)) -eq $fcount2 ] || return 1 # more than one file created
echo $dumpdest/$lastf
}
parseipc() {
- typeset inf=$1
+ local inf=$1
test -f "$1" || return 1
awk '
$3 == "Shmid" {n=1;next}
@@ -377,7 +376,7 @@
grep -w $ORACLE_OWNER | awk '{print $2}'
}
ipcdesc() {
- typeset what=$1
+ local what=$1
case $what in
m) echo "shared memory segment";;
s) echo "semaphore";;
@@ -385,14 +384,14 @@
esac
}
rmipc() {
- typeset what=$1 id=$2
+ local what=$1 id=$2
ipcs -$what | filteroraipc | grep -w $id >/dev/null 2>&1 ||
return
ocf_log info "Removing `ipcdesc $what` $id."
ipcrm -$what $id
}
ipcrm_orauser() {
- typeset what id
+ local what id
for what in m s q; do
for id in `ipcs -$what | filteroraipc`; do
rmipc $what $id
@@ -400,7 +399,7 @@
done
}
ipcrm_instance() {
- typeset ipcobj
+ local ipcobj
for ipcobj; do
rmipc `echo $ipcobj | sed 's/:/ /'`
done
@@ -449,7 +448,7 @@
#
oracle_start() {
- typeset status output
+ local status output
if is_oracle_up; then
status="`dbasql dbstat`"
case "$status" in
@@ -512,7 +511,7 @@
# oracle_stop: Stop the Oracle instance
#
oracle_stop() {
- typeset status output ipc=""
+ local status output ipc=""
if is_oracle_up; then
[ "$IPCRM" = "instance" ] && ipc=$(parseipc `dumpinstipc`)
output=`dbasql dbstop`
@@ -535,7 +534,7 @@
# kill the database processes (if any left)
# give them 30 secs to exit cleanly (6 times 5)
killprocs() {
- typeset sig=$1
+ local sig=$1
shift 1
kill -$sig $* >/dev/null 2>&1
}
@@ -622,7 +621,7 @@
procs="ps -e -o pid,args | grep -i \"[o]ra.*$ORACLE_SID\""
US=`id -u -n`
-if [ $US != root -a $US != $ORACLE_OWNER ]
+if [ $US != root ] && [ $US != $ORACLE_OWNER ]
then
ocf_log err "$0 must be run as root or $ORACLE_OWNER"
exit $OCF_ERR_PERM
diff -urN heartbeat-2.1.4.old/resources/OCF/oralsnr heartbeat-2.1.4/resources/OCF/oralsnr
--- heartbeat-2.1.4.old/resources/OCF/oralsnr 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/oralsnr 2008-11-30 22:40:59.000000000 -0500
@@ -157,10 +157,10 @@
testoraenv() {
# Let's make sure a few important things are set...
- [ x != "x$ORACLE_HOME" -a x != "x$ORACLE_OWNER" ] ||
+ [ x != "x$ORACLE_HOME" ] && [ x != "x$ORACLE_OWNER" ] ||
return 1
# and some important things are there
- [ -x "$sqlplus" -a -x "$lsnrctl" -a -x "$tnsping" ] ||
+ [ -x "$sqlplus" ] && [ -x "$lsnrctl" ] && [ -x "$tnsping" ] ||
return 1
return 0
}
@@ -190,7 +190,7 @@
#
oralsnr_start() {
- typeset output
+ local output
if tnsping; then
: nothing to be done, we can leave right now
ocf_log info "Listener $listener already running"
@@ -211,7 +211,7 @@
# oralsnr_stop: Stop the Oracle instance
#
oralsnr_stop() {
- typeset status output
+ local status output
if is_oralsnr_up; then
output=`echo $lsnrctl stop $listener | runasdba`
else
@@ -239,7 +239,7 @@
killprocs KILL `eval $procs | awk '{print $1}'`
}
killprocs() {
- typeset sig=$1
+ local sig=$1
shift 1
kill -$sig $* >/dev/null 2>&1
}
@@ -330,7 +330,7 @@
procs="ps -e -o pid,args | grep '[t]nslsnr' | grep -w $listener"
US=`id -u -n`
-if [ $US != root -a $US != $ORACLE_OWNER ]
+if [ $US != root ] && [ $US != $ORACLE_OWNER ]
then
ocf_log err "$0 must be run as root or $ORACLE_OWNER"
exit $OCF_ERR_PERM
diff -urN heartbeat-2.1.4.old/resources/OCF/pgsql heartbeat-2.1.4/resources/OCF/pgsql
--- heartbeat-2.1.4.old/resources/OCF/pgsql 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/pgsql 2008-11-30 20:39:15.000000000 -0500
@@ -393,7 +393,7 @@
US=`id -u -n`
-if [ $US != root -a $US != $OCF_RESKEY_pgdba ]
+if [ $US != root ] && [ $US != $OCF_RESKEY_pgdba ]
then
ocf_log err "$0 must be run as root or $OCF_RESKEY_pgdba"
exit $OCF_ERR_GENERIC
diff -urN heartbeat-2.1.4.old/resources/OCF/pingd heartbeat-2.1.4/resources/OCF/pingd
--- heartbeat-2.1.4.old/resources/OCF/pingd 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/pingd 2008-11-30 20:35:03.000000000 -0500
@@ -174,7 +174,7 @@
kill -9 $pid
rc=$?
- if [ $rc = 0 -o $rc = 1 ]; then
+ if [ $rc = 0 ] || [ $rc = 1 ]; then
rm $OCF_RESKEY_pidfile
exit $OCF_SUCCESS
fi
diff -urN heartbeat-2.1.4.old/resources/OCF/rsyncd heartbeat-2.1.4/resources/OCF/rsyncd
--- heartbeat-2.1.4.old/resources/OCF/rsyncd 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/rsyncd 2008-11-30 21:00:55.000000000 -0500
@@ -114,7 +114,7 @@
rsyncd_status()
{
- if [ -n "$PIDFILE" -a -f $PIDFILE ]; then
+ if [ -n "$PIDFILE" ] && [ -f $PIDFILE ]; then
# rsync is probably running
PID=`cat $PIDFILE`
if [ -n "$PID" ]; then
@@ -203,11 +203,11 @@
rsyncd_validate_all()
{
- if [ -n "$OCF_RESKEY_binpath" -a ! -x "$OCF_RESKEY_binpath" ]; then
+ if [ -n "$OCF_RESKEY_binpath" ] && [ ! -x "$OCF_RESKEY_binpath" ]; then
ocf_log err "Binary path $OCF_RESKEY_binpath does not exist."
exit $OCF_ERR_ARGS
fi
- if [ -n "$OCF_RESKEY_conffile" -a ! -f "$OCF_RESKEY_conffile" ]; then
+ if [ -n "$OCF_RESKEY_conffile" ] && [ ! -f "$OCF_RESKEY_conffile" ]; then
ocf_log err "Config file $OCF_RESKEY_conffile does not exist."
exit $OCF_ERR_ARGS
fi
diff -urN heartbeat-2.1.4.old/resources/OCF/SAPDatabase heartbeat-2.1.4/resources/OCF/SAPDatabase
--- heartbeat-2.1.4.old/resources/OCF/SAPDatabase 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/SAPDatabase 2008-11-30 20:34:29.000000000 -0500
@@ -536,7 +536,7 @@
if [ -x "$VALUE" ]
then
ocf_log info "Calling userexit ${NAME} with customer script file ${VALUE}"
- eval "$VALUE" >& /dev/null
+ eval "$VALUE" >/dev/null 2>&1
ocf_log info "Exiting userexit ${NAME} with customer script file ${VALUE}, returncode: $?"
else
ocf_log warn "Attribute ${NAME} is set to ${VALUE}, but this file is not executable"
@@ -568,7 +568,7 @@
rc=$?
fi
- if [ $rc -ne 0 -a $OCF_RESKEY_AUTOMATIC_RECOVER -eq 1 ]
+ if [ $rc -ne 0 ] && [ $OCF_RESKEY_AUTOMATIC_RECOVER -eq 1 ]
then
ocf_log warn "SAP database $SID start failed: $output"
ocf_log warn "Try to recover database $SID"
@@ -679,7 +679,7 @@
FRAME="$BOOTSTRAP"/../server0/bin/system/frame.jar
# only start jdbcconnect when all jars available
- if [ -f "$EXCEPTION" -a -f "$LOGGING" -a -f "$OPENSQLSTA" -a -f "$TC_SEC_SECSTOREFS" -a -f "$JDDI" -a -f "$ANTLR" -a -f "$FRAME" -a -f "$SAPDBCONNECT" ]
+ if [ -f "$EXCEPTION" ] && [ -f "$LOGGING" ] && [ -f "$OPENSQLSTA" ] && [ -f "$TC_SEC_SECSTOREFS" ] && [ -f "$JDDI" ] && [ -f "$ANTLR" ] && [ -f "$FRAME" ] && [ -f "$SAPDBCONNECT" ]
then
MYCP=".:$FRAME:$ANTLR:$JDDI:$IAIK_JCE_EXPORT:$IAIK_JCE:$EXCEPTION:$LOGGING:$OPENSQLSTA:$TC_SEC_SECSTOREFS:$DB_JARS:$SAPDBCONNECT"
EXECMD="com.sap.inst.jdbc.connect.JdbcCon -sec $SID:$SID"
@@ -687,7 +687,7 @@
# WebAS Java 7.10
LAUNCHER=${BOOTSTRAP}/sap.com~tc~bl~offline_launcher~impl.jar
- if [ -f "$DB_JARS" -a -f "$SAPDBCONNECT" -a -f "$LAUNCHER" ]
+ if [ -f "$DB_JARS" ] && [ -f "$SAPDBCONNECT" ] && [ -f "$LAUNCHER" ]
then
MYCP="$LAUNCHER"
EXECMD="com.sap.engine.offline.OfflineToolStart com.sap.inst.jdbc.connect.JdbcCon ${SAPDBCONNECT}:${SECSTORE}:${DB_JARS}:${BOOTSTRAP} -sec $SID:$SID"
@@ -904,7 +904,7 @@
then
MYPATH=`echo "$SAPSTARTDB" | head -1`
MYPATH=`dirname "$MYPATH"`
- if [ -x $MYPATH/$EXESTARTDB -a -x $MYPATH/$EXESTOPDB -a -x $MYPATH/$EXEDBCONNECT ]
+ if [ -x $MYPATH/$EXESTARTDB ] && [ -x $MYPATH/$EXESTOPDB ] && [ -x $MYPATH/$EXEDBCONNECT ]
then
DIR_EXECUTABLE=$MYPATH
SAPSTARTDB=$MYPATH/$EXESTARTDB
diff -urN heartbeat-2.1.4.old/resources/OCF/SAPInstance heartbeat-2.1.4/resources/OCF/SAPInstance
--- heartbeat-2.1.4.old/resources/OCF/SAPInstance 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/SAPInstance 2008-11-30 20:54:18.000000000 -0500
@@ -186,7 +186,7 @@
# now make sure the daemon has been started and is able to respond
srvrc=1
- while [ $srvrc -eq 1 -a `pgrep -f "sapstartsrv.*$runninginst" | wc -l` -gt 0 ]
+ while [ $srvrc -eq 1 ] && [ `pgrep -f "sapstartsrv.*$runninginst" | wc -l` -gt 0 ]
do
sleep 1
$SAPCONTROL -nr $InstanceNr -function GetProcessList > /dev/null 2>&1
@@ -224,7 +224,7 @@
if [ -x "$VALUE" ]
then
ocf_log info "Calling userexit ${NAME} with customer script file ${VALUE}"
- eval "$VALUE" >& /dev/null
+ eval "$VALUE" >/dev/null 2>&1
ocf_log info "Exiting userexit ${NAME} with customer script file ${VALUE}, returncode: $?"
else
ocf_log warn "Attribute ${NAME} is set to ${VALUE}, but this file is not executable"
@@ -286,7 +286,7 @@
startrc=0; loopcount=2
fi
else
- if [ $loopcount -eq 1 -a $OCF_RESKEY_AUTOMATIC_RECOVER -eq 1 ]
+ if [ $loopcount -eq 1 ] && [ $OCF_RESKEY_AUTOMATIC_RECOVER -eq 1 ]
then
ocf_log warn "SAP Instance $SID-$InstanceName start failed: $output"
ocf_log warn "Try to recover $SID-$InstanceName"
@@ -398,7 +398,7 @@
esac
done
- if [ $count -eq 0 -a $rc -eq $OCF_SUCCESS ]
+ if [ $count -eq 0 ] && [ $rc -eq $OCF_SUCCESS ]
then
if [ "$MONLOG" != "NOLOG" ]
then
@@ -493,12 +493,12 @@
# optional OCF parameters, we try to guess which directories are correct
if [ -z "$OCF_RESKEY_DIR_EXECUTABLE" ]
then
- if [ -x /usr/sap/$SID/$InstanceName/exe/sapstartsrv -a -x /usr/sap/$SID/$InstanceName/exe/sapcontrol ]
+ if [ -x /usr/sap/$SID/$InstanceName/exe/sapstartsrv ] && [ -x /usr/sap/$SID/$InstanceName/exe/sapcontrol ]
then
DIR_EXECUTABLE="/usr/sap/$SID/$InstanceName/exe"
SAPSTARTSRV="/usr/sap/$SID/$InstanceName/exe/sapstartsrv"
SAPCONTROL="/usr/sap/$SID/$InstanceName/exe/sapcontrol"
- elif [ -x /usr/sap/$SID/SYS/exe/run/sapstartsrv -a -x /usr/sap/$SID/SYS/exe/run/sapcontrol ]
+ elif [ -x /usr/sap/$SID/SYS/exe/run/sapstartsrv ] && [ -x /usr/sap/$SID/SYS/exe/run/sapcontrol ]
then
DIR_EXECUTABLE="/usr/sap/$SID/SYS/exe/run"
SAPSTARTSRV="/usr/sap/$SID/SYS/exe/run/sapstartsrv"
diff -urN heartbeat-2.1.4.old/resources/OCF/SendArp heartbeat-2.1.4/resources/OCF/SendArp
--- heartbeat-2.1.4.old/resources/OCF/SendArp 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/SendArp 2008-11-30 14:59:53.000000000 -0500
@@ -214,7 +214,7 @@
}
sendarp_validate() {
- if [ -z "$INTERFACE" -o -z "$BASEIP" -o -n "$RESIDUAL" ]
+ if [ -z "$INTERFACE" ] || [ -z "$BASEIP" ] || [ -n "$RESIDUAL" ]
then
return $OCF_ERR_ARGS
fi
diff -urN heartbeat-2.1.4.old/resources/OCF/SysInfo heartbeat-2.1.4/resources/OCF/SysInfo
--- heartbeat-2.1.4.old/resources/OCF/SysInfo 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/SysInfo 2008-11-30 20:28:09.000000000 -0500
@@ -4,7 +4,7 @@
# SysInfo OCF Resource Agent
# It records (in the CIB) various attributes of a node
#
-# Copyright (c) 2004 SUSE LINUX AG, Lars Marowsky-Br�e
+# Copyright (c) 2004 SUSE LINUX AG, Lars Marowsky-Br�e
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
@@ -107,7 +107,7 @@
UpdateStat() {
name=$1; shift
value="$*"
- echo -e "$name:\t$value"
+ printf "$name:\t$value"
${HA_SBIN_DIR}/attrd_updater ${OCF_RESKEY_delay} -S status -n $name -v "$value"
}
@@ -124,17 +124,17 @@
mem_used=`SysInfo_mem_units $mem_used`
mem_total=`expr $mem_used + $mem`
cpu_type=`system_profiler SPHardwareDataType | grep "CPU Type:"`
- cpu_type=${cpu_type/*: /}
+ cpu_type=$(echo $cpu_type | awk 'BEGIN { FS = ":[[:space:]]+" }; { print $2 }')
cpu_speed=`system_profiler SPHardwareDataType | grep "CPU Speed:" | awk '{print $3}'`
cpu_cores=`system_profiler SPHardwareDataType | grep "Number Of"`
- cpu_cores=${cpu_cores/*: /}
+ cpu_cores=$(echo $cpu_cores | awk 'BEGIN { FS = ":[[:space:]]+" }; { print $2 }')
;;
"Linux")
if [ -f /proc/cpuinfo ]; then
cpu_type=`grep "model name" /proc/cpuinfo | head -n 1`
- cpu_type=${cpu_type/*: /}
+ cpu_type=$(echo $cpu_type | awk 'BEGIN { FS = ":[[:space:]]+" }; { print $2 }')
cpu_speed=`grep "bogomips" /proc/cpuinfo | head -n 1`
- cpu_speed=${cpu_speed/*: /}
+ cpu_speed=$(echo $cpu_speed | awk 'BEGIN { FS = ":[[:space:]]+" }; { print $2 }')
cpu_cores=`grep "^processor" /proc/cpuinfo | wc -l`
fi
@@ -188,96 +188,96 @@
SysInfo_mem_units() {
mem=$1
- if [ -z $1 ]; then
+ if [ -z $1 ]; then
return
fi
- memlen=`expr ${#mem} - 1`
- memlen_alt=`expr ${#mem} - 2`
- if [ ${mem:$memlen:1} = "G" ]; then
- mem="${mem:0:$memlen}"
- if [ $mem != ${mem/./} ]; then
- mem_before=${mem/.*/}
- mem_after=${mem/*./}
- mem=$[mem_before*1024]
+ memlen=${#mem}
+ memlen_alt=`expr ${#mem} - 1`
+ if [ $(echo $mem | awk -v var=$memlen '{ string=substr($1, var, 1); print string; }' ) = "G" ]; then
+ mem="$(echo $mem | awk -v var=$memlen '{ string=substr($1, 1, var - 1); print string; }' )"
+ if [ $mem != "$(echo $mem | sed -e 's/\.//')" ]; then
+ mem_before=$(echo $mem | sed -e 's/\..*//' )
+ mem_after=$(echo $mem | sed -e 's/.*\.//' )
+ mem=$((mem_before*1024))
if [ ${#mem_after} = 0 ]; then
:
elif [ ${#mem_after} = 1 ]; then
- mem=$[mem+100*$mem_after]
+ mem=$((mem+100*$mem_after))
elif [ ${#mem_after} = 2 ]; then
- mem=$[mem+10*$mem_after]
+ mem=$((mem+10*$mem_after))
elif [ ${#mem_after} = 3 ]; then
- mem=$[mem+$mem_after]
+ mem=$((mem+$mem_after))
else
- mem_after=${mem_after:0:3}
- mem=$[mem+$mem_after]
+ mem_after=$(echo $mem_after | awk '{ string=substr($1, 1, 3); print string; }' )
+ mem=$((mem+$mem_after))
fi
fi
- elif [ ${mem:$memlen:1} = "M" ]; then
- mem=${mem/.*/}
- mem="${mem:0:$memlen}"
- elif [ ${mem:$memlen:1} = "k" ]; then
- mem="${mem:0:$memlen}"
- mem=${mem/.*/}
+ elif [ $(echo $mem | awk -v var=$memlen '{ string=substr($1, var, 1); print string; }' ) = "M" ]; then
+ mem=$(echo $mem | sed -e 's/\..*//' )
+ mem="$(echo $mem | awk -v var=$memlen '{ string=substr($1, 1, var - 1); print string; }' )"
+ elif [ $(echo $mem | awk -v var=$memlen '{ string=substr($1, var, 1); print string; }' ) = "k" ]; then
+ mem="$(echo $mem | awk -v var=$memlen '{ string=substr($1, 1, var - 1); print string; }' )"
+ mem=$(echo $mem | sed -e 's/\..*//' )
mem=`expr $mem / 1024`
- elif [ ${mem:$memlen_alt:2} = "kB" ]; then
- mem="${mem:0:$memlen_alt}"
- mem=${mem/.*/}
+ elif [ $(echo $mem | awk -v var=$memlen_alt '{ string=substr($1, var, 2); print string; }' ) = "kB" ]; then
+ mem="$(echo $mem | awk -v var=$memlen_alt '{ string=substr($1, 1, var - 1); print string; }' )"
+ mem=$(echo $mem | sed -e 's/\..*//' )
mem=`expr $mem / 1024`
- elif [ ${mem:$memlen_alt:2} = "Mb" ]; then
- mem="${mem:0:$memlen_alt}"
- mem=${mem/.*/}
- elif [ ${mem:$memlen_alt:2} = "MB" ]; then
- mem="${mem:0:$memlen_alt}"
- mem=${mem/.*/}
+ elif [ $(echo $mem | awk -v var=$memlen_alt '{ string=substr($1, var, 2); print string; }' ) = "Mb" ]; then
+ mem="$(echo $mem | awk -v var=$memlen_alt '{ string=substr($1, 1, var - 1); print string; }' )"
+ mem=$(echo $mem | sed -e 's/\..*//' )
+ elif [ $(echo $mem | awk -v var=$memlen_alt '{ string=substr($1, var, 2); print string; }' ) = "MB" ]; then
+ mem="$(echo $mem | awk -v var=$memlen_alt '{ string=substr($1, 1, var - 1); print string; }' )"
+ mem=$(echo $mem | sed -e 's/\..*//' )
fi
# Round to the next multiple of 50
- memlen=`expr ${#mem} - 2`
- mem_round="${mem:$memlen:2}"
+ memlen=`expr ${#mem} - 1`
+ mem_round="$(echo $mem | awk -v var=$memlen '{ string=substr($1, var, 2); print string; }' )"
if [ x$mem_round = x ]; then
:
elif [ $mem_round = "00" ]; then
:
elif [ $mem_round -lt "50" ]; then
- mem=$[mem+50]
- mem=$[mem-$mem_round]
+ mem=$((mem+50))
+ mem=$((mem-$mem_round))
else
- mem=$[mem+100]
- mem=$[mem-$mem_round]
+ mem=$((mem+100))
+ mem=$((mem-$mem_round))
fi
- echo $mem
+ echo $mem
}
SysInfo_hdd_units() {
disk=$1
- disklen=`expr ${#disk} - 1`
- disklen_alt=`expr ${#disk} - 2`
- if [ ${disk:$disklen:1} = "G" ]; then
- disk="${disk:0:$disklen}"
- elif [ ${disk:$disklen:1} = "M" ]; then
- disk="${disk:0:$disklen}"
- disk=${disk/.*/}
+ disklen=${#disk}
+ disklen_alt=`expr ${#disk} - 1`
+ if [ $(echo $disk | awk -v var=$disklen '{ string=substr($1, var, 1); print string; }' ) = "G" ]; then
+ disk="$(echo $disk | awk -v var=$disklen '{ string=substr($1, 1, var - 1); print string; }' )"
+ elif [ $(echo $disk | awk -v var=$disklen '{ string=substr($1, var, 1); print string; }' ) = "M" ]; then
+ disk="$(echo $disk | awk -v var=$disklen '{ string=substr($1, 1, var - 1); print string; }' )"
+ disk=$(echo $disk | sed -e 's/\..*//' )
disk=`expr $disk / 1024`
- elif [ ${disk:$disklen:1} = "k" ]; then
- disk="${disk:0:$disklen}"
- disk=${disk/.*/}
+ elif [ $(echo $disk | awk -v var=$disklen '{ string=substr($1, var, 1); print string; }' ) = "k" ]; then
+ disk="$(echo $disk | awk -v var=$disklen '{ string=substr($1, 1, var - 1); print string; }' )"
+ disk=$(echo $disk | sed -e 's/\..*//' )
disk=`expr $disk / 1048576`
- elif [ ${disk:$disklen_alt:2} = "kB" ]; then
- disk="${disk:0:$disklen_alt}"
- disk=${disk/.*/}
+ elif [ $(echo $disk | awk -v var=$disklen_alt '{ string=substr($1, var, 2); print string; }' ) = "kB" ]; then
+ disk="$(echo $disk | awk -v var=$disklen_alt '{ string=substr($1, 1, var - 1); print string; }' )"
+ disk=$(echo $disk | sed -e 's/\..*//' )
disk=`expr $disk / 1048576`
- elif [ ${disk:$disklen_alt:2} = "Mb" ]; then
- disk="${disk:0:$disklen_alt}"
- disk=${disk/.*/}
+ elif [ $(echo $disk | awk -v var=$disklen_alt '{ string=substr($1, var, 2); print string; }' ) = "Mb" ]; then
+ disk="$(echo $disk | awk -v var=$disklen_alt '{ string=substr($1, 1, var - 1); print string; }' )"
+ disk=$(echo $disk | sed -e 's/\..*//' )
disk=`expr $disk / 1024`
- elif [ ${disk:$disklen_alt:2} = "MB" ]; then
- disk="${disk:0:$disklen_alt}"
- disk=${disk/.*/}
+ elif [ $(echo $disk | awk -v var=$disklen_alt '{ string=substr($1, var, 2); print string; }' ) = "MB" ]; then
+ disk="$(echo $disk | awk -v var=$disklen_alt '{ string=substr($1, 1, var - 1); print string; }' )"
+ disk=$(echo $disk | sed -e 's/\..*//' )
disk=`expr $disk / 1024`
fi
- echo $disk
+ echo $disk
}
SysInfo_usage() {
diff -urN heartbeat-2.1.4.old/resources/OCF/WAS heartbeat-2.1.4/resources/OCF/WAS
--- heartbeat-2.1.4.old/resources/OCF/WAS 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/WAS 2008-11-30 21:01:49.000000000 -0500
@@ -155,7 +155,7 @@
then
XMLcat=`which xmllint 2>/dev/null`
if
- [ "X${XMLcat}" = X -o ! -x "${XMLcat}" ]
+ [ "X${XMLcat}" = X ] || [ ! -x "${XMLcat}" ]
then
XMLcat=cat
else
diff -urN heartbeat-2.1.4.old/resources/OCF/Xen heartbeat-2.1.4/resources/OCF/Xen
--- heartbeat-2.1.4.old/resources/OCF/Xen 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/Xen 2008-11-30 20:41:30.000000000 -0500
@@ -166,7 +166,7 @@
if [ "X${STATUS}" != "X" ]; then
# we have Xen 3.0.4 or higher
STATUS_NOSPACES=`echo "$STATUS" | awk '{ print $1,$2}'`
- if [ "$STATUS_NOSPACES" = "(status 2)" -o "$STATUS_NOSPACES" = "(status 1)" ]; then
+ if [ "$STATUS_NOSPACES" = "(status 2)" ] || [ "$STATUS_NOSPACES" = "(status 1)" ]; then
return $OCF_SUCCESS
else
return $OCF_NOT_RUNNING
@@ -190,7 +190,7 @@
RUNNING=`Xen_List_running`
RUNCNT=`Xen_Count_running`
MAXMEM=`Xen_Total_Memory`
- if [ ${RUNCNT} -eq 0 -a ${CNTNEW} -eq 0 ]; then
+ if [ ${RUNCNT} -eq 0 ] && [ ${CNTNEW} -eq 0 ]; then
RUNCNT=1
fi
#NEWMEM=`echo "(${MAXMEM}-${OCF_RESKEY_reserved_Dom0_memory})/(${RUNCNT}+${CNTNEW})"|bc`
@@ -280,7 +280,7 @@
elif [ -n "$OCF_RESKEY_CRM_meta_timeout" ]; then
# Allow 2/3 of the action timeout for the orderly shutdown
# (The origin unit is ms, hence the conversion)
- timeout=$[OCF_RESKEY_CRM_meta_timeout/1500]
+ timeout=$((OCF_RESKEY_CRM_meta_timeout/1500))
else
timeout=60
fi
@@ -290,7 +290,7 @@
xm shutdown ${DOMAIN_NAME}
while Xen_Status ${DOMAIN_NAME} && [ "$timeout" -gt 0 ]; do
- timeout=$[timeout-1]
+ timeout=$((timeout-1))
sleep 1
done
fi
diff -urN heartbeat-2.1.4.old/resources/OCF/Xinetd heartbeat-2.1.4/resources/OCF/Xinetd
--- heartbeat-2.1.4.old/resources/OCF/Xinetd 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/resources/OCF/Xinetd 2008-11-30 20:37:03.000000000 -0500
@@ -252,7 +252,7 @@
;;
esac
- if [ ! -z "$type" -a "INTERNAL" != "$type" ]; then
+ if [ ! -z "$type" ] && [ "INTERNAL" != "$type" ]; then
# Type is explicitly set to EXTERNAL, hence server and user are necessary.
case $server in
"") ocf_log err "Please specify server in $RCFILE"
@@ -283,7 +283,7 @@
esac
# Protocol is necessary when type is MUX
- if [ $type = "TCPMUX" -o $type ="TCPMUXPLUS" ]; then
+ if [ $type = "TCPMUX" ] || [ $type ="TCPMUXPLUS" ]; then
case $protocol in
"") ocf_log err "Please specify protocol in $RCFILE"
exit $OCF_ERR_CONFIGURED
diff -urN heartbeat-2.1.4.old/snmp_subagent/SNMPAgentSanityCheck.in heartbeat-2.1.4/snmp_subagent/SNMPAgentSanityCheck.in
--- heartbeat-2.1.4.old/snmp_subagent/SNMPAgentSanityCheck.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/snmp_subagent/SNMPAgentSanityCheck.in 2008-11-30 13:24:51.000000000 -0500
@@ -211,7 +211,7 @@
kill $HBAGENTPID
if
- [ -f $SNMPPIDFILE -a ! -z $SNMPPIDFILE ]
+ [ -f $SNMPPIDFILE ] && [ ! -z $SNMPPIDFILE ]
then
kill `cat $SNMPPIDFILE`
rm -f $SNMPPIDFILE
diff -urN heartbeat-2.1.4.old/tools/hb_report.in heartbeat-2.1.4/tools/hb_report.in
--- heartbeat-2.1.4.old/tools/hb_report.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/tools/hb_report.in 2008-11-30 14:34:04.000000000 -0500
@@ -420,8 +420,8 @@
cibdiff() {
d1=`dirname $1`
d2=`dirname $2`
- if [ -f $d1/RUNNING -a -f $d2/RUNNING ] ||
- [ -f $d1/STOPPED -a -f $d2/STOPPED ]; then
+ if $( [ -f $d1/RUNNING ] && [ -f $d2/RUNNING ] ) ||
+ $( [ -f $d1/STOPPED ] && [ -f $d2/STOPPED ] ); then
crm_diff -c -n $1 -o $2
else
echo "can't compare cibs from running and stopped systems"
@@ -718,7 +718,7 @@
if [ "$ssh_good" ]; then
start_remote_collectors
else
- if [ -z "$NO_SSH" -a `getnodes | wc -w` -gt 1 ]; then
+ if [ -z "$NO_SSH" ] && [ `getnodes | wc -w` -gt 1 ]; then
warning "ssh does not work to all nodes"
warning "please use the -u option if you want to supply a password"
fi
@@ -739,7 +739,7 @@
for l in $EXTRA_LOGS; do
[ "$NO_str2time" ] && break
- [ "$l" = "$HA_LOG" -o ! -f "$l" ] && continue
+ $( [ "$l" = "$HA_LOG" ] || [ ! -f "$l" ] ) && continue
getstampproc=`find_getstampproc < $l`
if [ "$getstampproc" ]; then
export getstampproc # used by linetime
diff -urN heartbeat-2.1.4.old/tools/ocf-tester.in heartbeat-2.1.4/tools/ocf-tester.in
--- heartbeat-2.1.4.old/tools/ocf-tester.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/tools/ocf-tester.in 2008-11-30 14:35:34.000000000 -0500
@@ -293,7 +293,7 @@
echo "* Your agent does not support the promote action (optional)"
fi
-if [ $has_promote -eq 1 -a $has_demote -eq 1 ]; then
+if [ $has_promote -eq 1 ] && [ $has_demote -eq 1 ]; then
test_command demote "Testing: demotion of started resource"
assert $? 0 "Demoting a start resource should not fail"
@@ -315,7 +315,7 @@
test_command demote "Demoting resource"
assert $? 0 "Demote failed" 1
-elif [ $has_promote -eq 0 -a $has_demote -eq 0 ]; then
+elif [ $has_promote -eq 0 ] && [ $has_demote -eq 0 ]; then
echo "* Your agent does not support master/slave (optional)"
else
diff -urN heartbeat-2.1.4.old/tsa_plugin/linuxha-adapter.in heartbeat-2.1.4/tsa_plugin/linuxha-adapter.in
--- heartbeat-2.1.4.old/tsa_plugin/linuxha-adapter.in 2008-08-18 08:32:19.000000000 -0400
+++ heartbeat-2.1.4/tsa_plugin/linuxha-adapter.in 2008-11-30 13:36:59.000000000 -0500
@@ -19,7 +19,7 @@
. @sysconfdir@/ha.d/shellfuncs
-function logit ()
+logit ()
{
if [ $LOG_LVL -ge $1 ]
then
@@ -37,7 +37,7 @@
# return:
# Value: String after "="
#
-function getValue ()
+getValue ()
{
R=$(cat $1 | grep ^$2 | sed s/' '//g | sed s/.*=// | sed s/\"//g )
if [ -z "$R" ]
@@ -55,7 +55,7 @@
}
-function getJavaPath ()
+getJavaPath ()
{
JPATH=""
case "$UNAME" in
@@ -73,7 +73,7 @@
echo $JPATH
}
-function getStatus ()
+getStatus ()
{
RC=0
PID=$(ps ax | grep -v grep | grep "$SAM_EYE_CATCHER" | grep -v " D " | head -1 | sed s/' '*// | cut -f1 -d" ")
@@ -88,7 +88,7 @@
return $RC
}
-function startEventd ()
+startEventd ()
{
${TSA_EVENTD} -s
if [ $? -eq 0 ] ; then
@@ -105,12 +105,12 @@
return 0
}
-function stopEventd ()
+stopEventd ()
{
${TSA_EVENTD} -k
}
-function startAdapter ()
+startAdapter ()
{
getStatus
RC=$?
@@ -170,7 +170,7 @@
}
-function stopAdapter()
+stopAdapter()
{
rm -f /tmp/$adapter.*
getStatus
signature.asc
Description: This is a digitally signed message part.

