CHORE: replace == with = that is bash syntax

This commit is contained in:
Charles Herlin 2019-02-26 15:23:23 +01:00
parent 41ccd5655a
commit d05ffaf9d5
4 changed files with 8 additions and 8 deletions

View File

@ -33,7 +33,7 @@ audit () {
if [ "$OWNER" != "$USER" ]; then
EXCEP_FOUND=0
for excep in $EXCEPTIONS; do
if [ "$DIR:$USER:$OWNER" == "$excep" ]; then
if [ "$DIR:$USER:$OWNER" = "$excep" ]; then
ok "The home directory ($DIR) of user $USER is owned by $OWNER but is part of exceptions ($DIR:$USER:$OWNER)."
EXCEP_FOUND=1
break

View File

@ -22,12 +22,12 @@ audit () {
FILES="$SYSLOG_BASEDIR/syslog-ng.conf $(find $SYSLOG_BASEDIR/conf.d/)"
for FILE in $FILES; do
does_pattern_exist_in_file_multiline "$FILE" "$PATTERN"
if [ $FNRET == 0 ]; then
if [ $FNRET = 0 ]; then
FOUND=1
fi
done
if [ $FOUND == 1 ]; then
if [ $FOUND = 1 ]; then
ok "$PATTERN is present in $FILES"
else
crit "$PATTERN is not present in $FILES"
@ -40,11 +40,11 @@ apply () {
FILES="$SYSLOG_BASEDIR/syslog-ng.conf $(find $SYSLOG_BASEDIR/conf.d/ -type f)"
for FILE in $FILES; do
does_pattern_exist_in_file_multiline "$FILE" "$PATTERN"
if [ $FNRET == 0 ]; then
if [ $FNRET = 0 ]; then
FOUND=1
fi
done
if [ $FOUND == 1 ]; then
if [ $FOUND = 1 ]; then
ok "$PATTERN is present in $FILES"
else
crit "$PATTERN is not present in $FILES, please set a remote host to send your logs"

View File

@ -25,11 +25,11 @@ audit () {
FOUND=0
for FILE in $FILES; do
does_pattern_exist_in_file "$FILE" "$PATTERN"
if [ "$FNRET" == 0 ]; then
if [ "$FNRET" = 0 ]; then
FOUND=1
fi
done
if [ $FOUND == 1 ]; then
if [ $FOUND = 1 ]; then
ok "$PATTERN is present in $FILES"
else
crit "$PATTERN is not present in $FILES"

View File

@ -36,7 +36,7 @@ audit () {
# previous line will capture actual policy
if [[ $ipt =~ $regex ]]; then
actual_policy=${BASH_REMATCH[1]}
if [[ $actual_policy == "$FW_POLICY" ]]; then
if [[ $actual_policy = "$FW_POLICY" ]]; then
ok "Policy correctly set to $FW_POLICY for chain $chain"
else
crit "Policy set to $actual_policy for chain $chain, should be ${FW_POLICY}."