SHA256
1
0
forked from pool/fetchmail
fetchmail/fetchmail.exec
P. Janouch 06b06198ff - Made /etc/sysconfig/fetchmail work again after a botched systemd
conversion that ignored the file altogether (bsc#905673)
- Removed the FETCHMAIL_USER setting in favor of editing the
  systemd service file (which should be copied to the respective
  location in /etc, and not edited in-place)

OBS-URL: https://build.opensuse.org/package/show/server:mail/fetchmail?expand=0&rev=65
2016-04-08 12:39:15 +00:00

22 lines
640 B
Bash

#!/bin/sh
# fetchmail-systemd-exec: sysconfig helper script for systemd
die() {
echo "$@" 1>&2
exit 1
}
echo "$FETCHMAIL_POLLING_INTERVAL" | grep -Eq '^[0-9]+$' \
|| die 'invalid $FETCHMAIL_POLLING_INTERVAL setting'
[ -r "$FETCHMAIL_RC_PATH" ] \
|| die '$FETCHMAIL_RC_PATH does not exist'
OPTS="-d $FETCHMAIL_POLLING_INTERVAL"
[ "$FETCHMAIL_FETCHALL" = "yes" ] && OPTS="$OPTS -a"
[ "$FETCHMAIL_SILENT" = "yes" ] && OPTS="$OPTS -s"
[ "`whoami`" = "fetchmail" -a -z "$FETCHMAILHOME" ] && \
export FETCHMAILHOME=/var/lib/fetchmail
exec /usr/bin/fetchmail $OPTS $FETCHMAIL_EXPERT_OPTIONS \
-f $FETCHMAIL_RC_PATH -L /var/log/fetchmail