postfix/files/start_tls.sh
Petr "Stone" Hracek 8c2330e38f First set of tests
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
2017-04-25 13:37:11 +02:00

25 lines
582 B
Bash
Executable file

#!/bin/bash
# Copy all certificates
#cp /var/certs/*.{crt,pem} /etc/postfix/
# Wait before postfix is really started.
postfix start
while true; do
state=$(script -c 'postfix status' | grep postfix/postfix-script)
echo $state
if [[ "$state" != "${state/is running/}" ]]; then
PID=${state//[^0-9]/}
if [[ -z $PID ]]; then
continue
fi
if [[ ! -d "/proc/$PID" ]]; then
echo "Postfix proces $PID does not exist."
break
fi
else
echo "Postfix is not running."
break
fi
done