docker-postfix/scripts/opendkim.sh
Bojan Čekrlić 35fa2d7acf Fix for #30 - Use sleep inifinity instead of sleep <number>
Apparently using sleep with very large numbers is not a good idea
when your image can be compiled down to 32-bit platforms.

This fix uses `sleep infinity` and -- failing that -- tries to
sleep for about 68 years (which is exactly 2^15 seconds).
2020-08-15 22:47:49 +02:00

19 lines
369 B
Bash

#!/bin/sh
noop() {
while true; do
# 2147483647 = max signed 32-bit integer
# 2147483647 s ≅ 70 years
sleep infinity || sleep 2147483647
done
}
if [ ! -d /etc/opendkim/keys ]; then
noop
elif [ -z "$(find /etc/opendkim/keys -type f ! -name .)" ]; then
noop
else
/usr/sbin/opendkim -D -f -x /etc/opendkim/opendkim.conf
fi