apache_wait_stop() {
# running ?
PIDTMP=$(pidof_apache) || true
if kill -0 "${PIDTMP:-}" 2> /dev/null; then
PID=$PIDTMP
fi
apache_stop
# wait until really stopped
if [ -n "${PID:-}" ]; then
i=0
while kill -0 "${PID:-}" 2> /dev/null; do
if [ $i = '60' ]; then
break;
else
if [ $i = '0' ]; then
echo -n " ... waiting "
else
echo -n "."
fi
i=$(($i+1))
sleep 1
fi
done
fi
}