--- /root/fetchmail 2007-11-28 23:47:34.932237334 -0500 +++ /root/fetchmail 2007-11-28 23:57:29.814043998 -0500 @@ -6,24 +6,30 @@ } checkconfig() { - if [ ! -f /etc/fetchmailrc ]; then - eerror "Configuration file /etc/fetchmailrc not found" - return 1 + if [ ! -h /etc/fetchmailrc ]; then + ln -fs /var/lib/fetchmail/fetchmailrc /etc/fetchmailrc + ewarn "Configuration symlink /etc/fetchmailrc not found - created" fi + if [ ! -f /var/lib/fetchmail/fetchmailrc ]; then + eerror "Configuration file /var/lib/fetchmail/fetchmailrc not found" + return 1 + fi } start() { checkconfig || return 1 ebegin "Starting fetchmail" - start-stop-daemon --start --chuid mail --quiet --exec /usr/bin/fetchmail \ - -- -d ${polling_period} -f /etc/fetchmailrc + start-stop-daemon --start --quiet \ + --chuid fetchmail --exec /usr/bin/fetchmail \ + -- -d ${polling_period} -f /var/lib/fetchmail/fetchmailrc eend ${?} } stop() { ebegin "Stopping fetchmail" - start-stop-daemon --stop --quiet --pidfile /var/run/fetchmail.pid + start-stop-daemon --stop --quiet \ + --pidfile /var/run/fetchmail/fetchmail.pid eend ${?} }