1
0
angie-conv-image/image-entry.d/90-angie-config-test.sh

34 lines
632 B
Bash
Raw Normal View History

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