We want evocheck advbase output to be uniq

This commit is contained in:
Tristan PILAT 2020-07-15 11:08:32 +02:00
parent 8d80e5bfc8
commit 239c5896df
1 changed files with 6 additions and 2 deletions

View File

@ -148,11 +148,15 @@ check_gitperms(){
check_advbase(){
if ls /etc/hostname.carp* 1> /dev/null 2>&1; then
bad_advbase=0
for advbase in $(ifconfig carp | grep advbase | awk -F 'advbase' '{print $2}' | awk '{print $1}' | xargs); do
if [[ "$advbase" -gt 1 ]]; then
failed "IS_ADVBASE" "At least one CARP interface has advbase greater than 5 seconds!"
if [[ "$advbase" -gt 5 ]]; then
bad_advbase=1
fi
done
if [[ "$bad_advbase" -eq 1 ]]; then
failed "IS_ADVBASE" "At least one CARP interface has advbase greater than 5 seconds!"
fi
fi
}