Copy .fetchmailrc from /config/ in entrypoint wrapper

This commit is contained in:
Frederick Ding 2015-07-30 22:04:01 -04:00
parent 65f0bc1173
commit 9ea87383ab

View File

@ -0,0 +1,25 @@
#!/bin/bash
# verify maildir
if [ -d /var/mail/working ]; then
echo "/var/mail/working exists"
else
maildirmake /var/mail/working
echo "to /var/mail/working" > /root/.mailfilter
fi
# check for user config fetchmailrc
if [ -f /config/.fetchmailrc ]; then
cp /config/.fetchmailrc /root/.fetchmailrc
chmod 0700 /root/.fetchmailrc
echo "Installed .fetchmailrc"
fi
if [ "$1" = 'cron' ] || [ "$1" = '/opt/save-attachments.sh' ]; then
if [ ! -f /root/.fetchmailrc ]; then
echo "Cannot start container without .fetchmailrc"
exit 1
fi
fi
exec "$@"