split IS_EVOMAINTENANCECONF in 3 checks

This commit is contained in:
Jérémy Lecour 2019-03-23 01:54:04 +01:00
parent f377df3370
commit 4daaf99e36

View file

@ -1380,19 +1380,23 @@ fi
# Verification de la configuration d'evomaintenance # Verification de la configuration d'evomaintenance
if [ "$IS_EVOMAINTENANCECONF" = 1 ]; then if [ "$IS_EVOMAINTENANCECONF" = 1 ]; then
f=/etc/evomaintenance.cf f=/etc/evomaintenance.cf
perms=$(stat -c "%a" $f) if [ -e "$f" ]; then
{ test -e $f \ perms=$(stat -c "%a" $f)
&& test "$perms" = "600" \ test "$perms" = "600" || failed "IS_EVOMAINTENANCECONF" "Wrong permissions on \`$f' ($perms instead of 600)"
&& grep "^export PGPASSWORD" $f | grep -qv "your-passwd" \
&& grep "^PGDB" $f | grep -qv "your-db" \ { grep "^export PGPASSWORD" $f | grep -qv "your-passwd" \
&& grep "^PGTABLE" $f | grep -qv "your-table" \ && grep "^PGDB" $f | grep -qv "your-db" \
&& grep "^PGHOST" $f | grep -qv "your-pg-host" \ && grep "^PGTABLE" $f | grep -qv "your-table" \
&& grep "^FROM" $f | grep -qv "jdoe@example.com" \ && grep "^PGHOST" $f | grep -qv "your-pg-host" \
&& grep "^FULLFROM" $f | grep -qv "John Doe <jdoe@example.com>" \ && grep "^FROM" $f | grep -qv "jdoe@example.com" \
&& grep "^URGENCYFROM" $f | grep -qv "mama.doe@example.com" \ && grep "^FULLFROM" $f | grep -qv "John Doe <jdoe@example.com>" \
&& grep "^URGENCYTEL" $f | grep -qv "06.00.00.00.00" \ && grep "^URGENCYFROM" $f | grep -qv "mama.doe@example.com" \
&& grep "^REALM" $f | grep -qv "example.com"; && grep "^URGENCYTEL" $f | grep -qv "06.00.00.00.00" \
} || failed "IS_EVOMAINTENANCECONF" "evomaintenance is not correctly configured" && grep "^REALM" $f | grep -qv "example.com";
} || failed "IS_EVOMAINTENANCECONF" "evomaintenance is not correctly configured"
else
failed "IS_EVOMAINTENANCECONF" "Configuration file \`$f' is missing"
fi
fi fi
if [ "$IS_PRIVKEYWOLRDREADABLE" = 1 ]; then if [ "$IS_PRIVKEYWOLRDREADABLE" = 1 ]; then