I have this script inside /etc/ppp/ip-up.d/script
#!/bin/sh
/usr/sbin/postqueue -c /etc/postfix -f
/usr/bin/fetchmail -v -f /etc/fetchmailrc -L /var/log/fetchmail.log
while ! postqueue -p | grep -q empty; do
sleep 1
done
killall wvdial
in this script it disconects my modem when detects that the mail queue is empty, also i wish to check if the fetchmail process is still running or execute the part of the while just and just after the fetchmail command finish to do his job completely.
some help please?