Copy .fetchmailrc from /config/ in entrypoint wrapper
This commit is contained in:
parent
65f0bc1173
commit
9ea87383ab
|
@ -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 "$@"
|
Loading…
Reference in New Issue
Block a user