#!/bin/sh # # description: It automates the starting of fetchmail with the starting of the system # # chkconfig: 345 11 92 # config:/root/.fetchmailrc # pidfile: /var/run/gpm.pid # Source of functions . /etc/init.d/functions # We obtain configuration . /etc/sysconfig/network # We verified that there is connection to network. if [ ${NETWORKING} = "no" ] then exit 0 fi # We verified if it is present fetchmail [ -x /usr/bin/fetchmail ] || exit 0 start() { echo -n "Starting mail retrieval: fetchmail " /usr/bin/fetchmail -f /root/.fetchmailrc echo "." } stop() { echo -n "Stopping mail retrieval: fetchmail " /usr/bin/fetchmail -q echo "." } case "$1" in start) start ;; stop) stop ;; status) status fetchmail RETVAL=$? ;; *) echo "Usage: /etc/init.d/fetchmail {start|stop|status}" >&2 exit 1 ;; esac exit 0