From: Matthias A. <mat...@gm...> - 2006-01-22 12:19:07
|
fink <fi...@ra...> writes: > I would like Fetchmail to check my mailserver periodically for new mail. > > I created a small script which just needs one argument (the exit code > from fetchmail): > > if [ $1 = 1] > then > echo 1 > /proc/acpi/asus/mled > else > echo 0 > /proc/acpi/asus/mled > fi > exit > > The trouble is now how to get the exit code passed to the script: When > fetchmail is running deamonised it never returns and thus the exit > code does not exist. Well, it would trash its value on the next run anyhow, besides that I think you got the logic in reverse. Exit code 0 = messages fetched/waiting, Exit code 1 = no mail. I'd suggest to use a cron job for such a setup and not daemon mode, that way you can perhaps set a flag file and LED if fetchmail exits 0, ignore fetchmail exiting 1, and reset the flag file when your mailer has been started or quit. -- Matthias Andree |