30
     	ˆÁÀÅ645¿ÃÂ …    	‹      Í–Ñn›0†ï÷ž/vHÒ6)aêB¥EkÓ¨eÚ¦i6Á*`d»Kº§Ÿ�¤M£¦ë$Ä&EÂ8?æûØØ^M¢oósô1º¼@óÏ.¦„-€/½	@…Í}ÛqÎgáTër°Z­ìUÏr	Ñ5¤:Ïú ´ä±¶©¦8xãW}Áä§ŒPsD¾æ:cÁ´ l�D‚@ÜiÅ)ó¶ "W XAž1›²\Ø©²c!Js*be)•mÓ}(¥ˆA§ÒŒo)–% …Ðp§$¨”Èj¸”ˆ‰¶&y™1åCÃ`¨`ƒå/½¯hÝLf ê"‘EX5eàëý$_c¬E‰ŸçK¤d<ÆÀcQ(Xd¤¸µ—<ÁˆdzŒ¿O'W?LÎÜ¾º:ð	2É¿ŸŒg§Wã3’3Èó™K“9ÃÁQå‚ò„3z0|Ó„oø¯Ã†M&d*–¼Ô\�Q0Š»ª±ÈTIŒëÀ¤r7ÕDèŸªAâ'Å˜Ÿ]ŸÏ¢pzÝ”„VC<Òuøœq07…F!—,ÖBÞoªÐ ½+ª<Ýž¢�£äËTã !=›ü‹Âh¶Ö»…‰¾FÏ–„ã\Ø*ÅÁCs—tÍsÜcËq-çyîhp‚Ð�àÐéuæ�è²hŽmÐ÷m÷SWô9áY�¿i´ÁïÙNgüfN¬ïk�mëeƒ¡åôÍ¹Îh0üXœŠG‹ÍY&®íufR-L/˜¥™ÒµÍ~O;F½Î�žÈ´äq4<îl�2_…[Õ'ÖÃk¶×ÑÎœtö\ü=›V]º{Ç&ËkæˆçYn½;Ã‘;8ü9>y�ÿ•[ Øl}¨7­>4[ìßãõä®Å    5   ˆl–ß=¿J	¥2ÛR‚ ‚ \¸Ó· ú˜´o�þBYF³dmæÈà„óÇƒuöAÆÄÃ ú    #!/bin/sh
#
# Fetchmail init script
# Latest change: Do Aug 30 16:04:39 CEST 2012
#
### BEGIN INIT INFO
# Provides:          fetchmail
# Required-Start:    $network $local_fs $remote_fs $syslog
# Required-Stop:     $remote_fs
# Should-Start:      $mail-transport-agent postfix exim4 $named
# Should-Stop:       $mail-transport-agent postfix exim4
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: init-Script for system wide fetchmail daemon
# Description: Enable service provided by fetchmail in daemon mode
### END INIT INFO
#
# A fetchmailrc file containg hosts and passwords for all local users should be
# placed in /etc/fetchmailrc.  Remember to make the /etc/fetchmailrc mode 600
# to avoid disclosing the users' passwords.
#
# This script will NOT start or stop fetchmail if the /etc/fetchmailrc file
# does not exist or if START_DAEMON in /etc/default/fetchmail is set to no.

set -e

# Defaults
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/fetchmail
USER=fetchmail
OPTIONS=""

CONFFILE="/etc/fetchmailrc"
PIDFILE="/var/run/fetchmail/fetchmail.pid"
UIDL="/var/lib/fetchmail/.fetchmail-UIDL-cache"
START_DAEMON="no"

. /lib/lsb/init-functions

if [ -r /etc/default/fetchmail ]; then
    . /etc/default/fetchmail
fi

OPTIONS="$OPTIONS -f $CONFFILE --pidfile $PIDFILE"

if [ ! "x$START_DAEMON" = "xyes" -a ! "$1" = "status" ]; then
	log_action_msg "Not starting fetchmail daemon, disabled via /etc/default/fetchmail"
	exit 0
fi

if [ ! -e $CONFFILE ]; then
    log_failure_msg "$CONFFILE not found."
    log_failure_msg "can not start fetchmail daemon... consider disabling the script"
    exit 6
fi


test -f $DAEMON || exit 0

if [ "$1" = "start" ]; then
    if [ ! -r $CONFFILE ] ; then
        log_failure_msg "$CONFFILE found but not readable."
        exit 0
    fi
fi


# sanity checks (saves on MY sanity :-P )
if ! id $USER >/dev/null 2>&1; then
	if [ "$USER" = "fetchmail" ]; then
		# The fetchmail user might have been removed when the fetchmail-common
		# package is purged. We have to re-add it here so the system-wide
		# daemon will run.

		adduser --system --ingroup nogroup --home /var/lib/fetchmail \
			--shell /bin/sh --disabled-password fetchmail >/dev/null 2>&1 || true
		# work around possible adduser bug, see #119366
		[ -d /var/lib/fetchmail ] || mkdir -p /var/lib/fetchmail
		chmod 700 /var/lib/fetchmail
		chown -h -R fetchmail:nogroup /var/lib/fetchmail
		[ -x /sbin/restorecon ] && /sbin/restorecon /var/lib/fetchmail
	else
		log_failure_msg "$0: $USER user does not exist!"
		exit 1
	fi
fi

# add daemon option if user hasn't already specified it
if ! grep -qs '^[[:space:]]*set[[:space:]]\+daemon[[:space:]]' "$CONFFILE"; then
	# Make sure user did not use -d on /etc/default/fetchmail
	if ! grep -qs -e '^[[:space:]]*OPTIONS=.*-d[[:space:]]*[[:digit:]]\+' "/etc/default/fetchmail"; then
		OPTIONS="$OPTIONS -d 300"
	fi
fi

# add syslog option unless user specified "set no syslog".
if ! grep -qs '^[[:space:]]*set[[:space:]]\+no[[:space:]]\+syslog' "$CONFFILE"; then
	OPTIONS="$OPTIONS --syslog"
fi

# support for ephemeral /var/run
if [ "${PIDFILE%/*}" = "/var/run/fetchmail" ] && [ ! -d ${PIDFILE%/*} ] && [ "$1" != "status" ]; then
	mkdir /var/run/fetchmail
	chown -h $USER:nogroup /var/run/fetchmail
	chmod 700 /var/run/fetchmail
	[ -x /sbin/restorecon ] && /sbin/restor