commit ae062c1e048e366b21cde327ba276f7351af3032 Author: socrates@luxemburg Date: Fri Dec 22 21:04:08 2023 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d938610 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +old.html diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fec306e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM debian:bookworm-slim + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt update \ + && apt -y upgrade\ + && apt -y install \ + cron \ + tzdata \ + && rm -rf /var/lib/apt/lists/* + +RUN cp -r -f /usr/share/zoneinfo/Europe/Berlin /etc/localtime + +COPY /wohn-hh-checker.sh /app/ +COPY /run.sh /app/ +COPY crontab /app/crontab + +RUN chmod +x /app/run.sh +RUN chmod +x /app/wohn-hh-checker.sh + +CMD [ "/app/run.sh" ] \ No newline at end of file diff --git a/crontab b/crontab new file mode 100644 index 0000000..e5f7f3b --- /dev/null +++ b/crontab @@ -0,0 +1,2 @@ +# m h dom mon dow cmd +*/15 * * * * cd /app/ && ./wohn-hh-checker.sh &> /proc/1/fd/1 \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..d3464d6 --- /dev/null +++ b/run.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "Wohn-HH-Checker Docker Container started!" > /proc/1/fd/1 + +crontab "/app/crontab" + +cron -f \ No newline at end of file diff --git a/wohn-hh-checker.sh b/wohn-hh-checker.sh new file mode 100755 index 0000000..d3e68ad --- /dev/null +++ b/wohn-hh-checker.sh @@ -0,0 +1,29 @@ +#!/bin/bash +mail="From: sockenklaus@gmail.com\n\ +To: pascalkoenig@duck.com\n\ +Subject: wohn-hh.de changed\n\ +\n\ +Visit: http://wohn-hh.de" + +new=$(curl -s http://wohn-hh.de) + +if [ -f "old.html" ]; then + + old=$( old.html + + + + + +