#!/bin/sh
#
# fetchmail
case "$1" in
'start')
for user in `ls /home/`
do
if [ -f /home/$user/.fetchmailrc ]; then
echo "fetchmail for $user starting."
su $user -c "/usr/local/bin/fetchmail"
fi
done
;;
'stop')
for user in `ls /home/`
do
if [ -f /home/$user/.fetchmailrc ]; then
su $user -c "/usr/local/bin/fetchmail --quit"
fi
done
/ ;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
|