File icinga-1.11.7-fix-bashisms.patch of Package icinga.9111
Index: icinga-1.12.0/indent.sh
===================================================================
--- icinga-1.12.0.orig/indent.sh
+++ icinga-1.12.0/indent.sh
@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/bin/sh
astyle --style=java --indent=tab --unpad-paren --pad-oper --pad-header --suffix=none --brackets=linux "$@"
Index: icinga-1.12.0/maketar.sh
===================================================================
--- icinga-1.12.0.orig/maketar.sh
+++ icinga-1.12.0/maketar.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
###
# Make a tarball
# (c) 2013 NETWAYS GmbH
Index: icinga-1.12.0/module/idoutils/db/scripts/create_mysqldb.sh
===================================================================
--- icinga-1.12.0.orig/module/idoutils/db/scripts/create_mysqldb.sh
+++ icinga-1.12.0/module/idoutils/db/scripts/create_mysqldb.sh
@@ -78,14 +78,14 @@ select now();
\q
EOS2
umask $UMASK
-if [ $? == 0 ]; then
+if [ $? = 0 ]; then
echo "Check icinga schema version with DB User $DBUSER..."
mysql $DB -u $DBUSER -p$DBPASS -h $DBHOST -s <<EOS3
select "DB-Version",version from icinga_dbversion where name='idoutils';
\q
EOS3
- if [ $? == 0 ]; then
+ if [ $? = 0 ]; then
echo "Database ready"
RET=0
else
Index: icinga-1.12.0/module/idoutils/db/scripts/create_oracledb.sh
===================================================================
--- icinga-1.12.0.orig/module/idoutils/db/scripts/create_oracledb.sh
+++ icinga-1.12.0/module/idoutils/db/scripts/create_oracledb.sh
@@ -72,7 +72,7 @@ connect sys/${SYSPASS}@${DB} as sysdba;
EOS1
RET=$?
-if [ $RET == 0 ]; then
+if [ $RET = 0 ]; then
#create icinga schema objects using newly created user
$SP /nolog <<EOS2
--exit if connect errornous
@@ -85,7 +85,7 @@ connect ${DBUSER}/${DBPASS}@${DB}
EOS2
RET=$?
#check if dbversion entered(last insert)
- if [ $RET == 0 ]; then
+ if [ $RET = 0 ]; then
echo "Connecting now as $DBUSER on $DB and check icinga schema version"
$SP /nolog <<EOS3
connect ${DBUSER}/${DBPASS}@${DB}
@@ -96,7 +96,7 @@ select sysdate from dual;
exit;
EOS3
- if [ $? == 0 ]; then
+ if [ $? = 0 ]; then
echo "Database ready"
RET=0
else
Index: icinga-1.12.0/selinux/icinga.sh
===================================================================
--- icinga-1.12.0.orig/selinux/icinga.sh
+++ icinga-1.12.0/selinux/icinga.sh
@@ -14,12 +14,12 @@ if [ $# -eq 1 ]; then
rules=`ausearch --start $time -m avc --raw -se icinga`
if [ x"$rules" != "x" ] ; then
echo "Found avc's to update policy with"
- echo -e "$rules" | audit2allow -R
+ echo "$rules" | audit2allow -R
echo "Do you want these changes added to policy [y/n]?"
read ANS
if [ "$ANS" = "y" -o "$ANS" = "Y" ] ; then
echo "Updating policy"
- echo -e "$rules" | audit2allow -R >> icinga.te
+ echo "$rules" | audit2allow -R >> icinga.te
# Fall though and rebuild policy
else
exit 0
@@ -29,11 +29,11 @@ if [ $# -eq 1 ]; then
exit 0
fi
else
- echo -e $USAGE
+ echo $USAGE
exit 1
fi
elif [ $# -ge 2 ] ; then
- echo -e $USAGE
+ echo $USAGE
exit 1
fi