Initial commit.
This commit is contained in:
commit
ab2f8dcfed
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
FROM debian:jessie
|
||||
MAINTAINER yohan <783b8c87@scimetis.net>
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
#RUN echo "deb http://http.debian.net/debian jessie-backports main" >> /etc/apt/sources.list
|
||||
RUN apt-get update && apt-get -y install feed2imap
|
||||
#COPY feed2imaprc /root/
|
||||
COPY entrypoint.sh /root/
|
||||
RUN chmod +x /root/entrypoint.sh
|
||||
ENTRYPOINT ["/root/entrypoint.sh"]
|
30
entrypoint.sh
Executable file
30
entrypoint.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
# stop service and clean up here
|
||||
function shut_down() {
|
||||
reset
|
||||
echo "exited $0"
|
||||
exit 0
|
||||
}
|
||||
|
||||
# USE the trap if you need to also do manual cleanup after the service is stopped,
|
||||
# or need to start multiple services in the one container
|
||||
trap "shut_down" SIGINT SIGTERM SIGKILL
|
||||
|
||||
echo "Launching feed2imap..."
|
||||
/usr/bin/feed2imap -f /root/feed2imaprc
|
||||
last=$(date +%s)
|
||||
|
||||
while true
|
||||
do
|
||||
sleep 3
|
||||
#echo $last
|
||||
# if date '+%s'` - $last > 1800 (seconds) ==> feed2imap and $last = date '+%s'`
|
||||
if [ $(($(date +%s) - $last)) -gt 1800 ]
|
||||
then
|
||||
echo "Launching feed2imap..."
|
||||
/usr/bin/feed2imap -f /root/feed2imaprc
|
||||
last=$(date +%s)
|
||||
fi
|
||||
done
|
||||
shut_down
|
||||
|
Loading…
Reference in New Issue
Block a user