1
0
angie-conv-image/image-entry.d/90-angie-config-test.sh
2024-09-17 14:11:00 +03:00

34 lines
632 B
Bash
Executable File

#!/bin/sh
set -f
. /image-entry.d/00-common.envsh
## Angie: unset core variable
unset ANGIE ANGIE_BPF_MAPS
_angie() {
angie -e stderr -g 'error_log /dev/stderr warn;' "$@"
}
## merely debug test
log_always 'test Angie configuration:'
log_always '========================='
_angie -t
r=$?
log_always '========================='
if [ $r = 0 ] ; then
log_always 'ready to run Angie'
_angie -T 2>&1 | cat > "${volume_root}/diag.angie.conf"
else
log_always 'configuration test has failed, see above'
t=15
log_always "injecting delay for $t seconds"
sleep $t
fi
## cleanup after test
rm -f "${volume_root}/angie.pid"
exit 0