From 6af77289e5542f942d6dd6e103c6021a75cf40bd Mon Sep 17 00:00:00 2001 From: Nicolas Date: Wed, 11 Jun 2025 14:41:52 -0400 Subject: [PATCH] Modify Dockerfile and xml-cleaner.sh Updated dockerfile to use cron in order to set up automated script execution once per day, every morning. --- Dockerfile | 9 ++------- xml_cleaner.sh | 3 +-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index cff8233..3317667 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,14 @@ FROM debian:12-slim +# Install wget and xmlstarlet, an optimized xml parser. Then clear apt cache RUN apt update && apt install -y --no-install-recommends \ bash \ wget \ - lighttpd \ - curl \ xmlstarlet \ && rm -rf /var/lib/apt/lists/* +# Copy channel id list to data directory, cleaner script to opt directory COPY xml_tv_ids.txt /data/ COPY xml_cleaner.sh /opt/ -# Going to need a static IP adress for this part -# RUN wget -P /data/ --no-check-certificate https://download2.iptvboss.pro/2da279ce-ce9a-4491-8b92-f72c60e92092/xmlonly/CANADA.xml \ -# && wget -P /data/ --no-check-certificate https://download2.iptvboss.pro/R5SQ-4GRG-KK00-0XQT-JZ67-7TSA-D5O7-UC1U/xmlonly/USA.xml - -# ENTRYPOINT ["/opt/xml_cleaner.sh"] CMD ["bash"] \ No newline at end of file diff --git a/xml_cleaner.sh b/xml_cleaner.sh index 035cd51..c8dc746 100644 --- a/xml_cleaner.sh +++ b/xml_cleaner.sh @@ -6,8 +6,7 @@ wget -q --no-check-certificate https://download2.iptvboss.pro/R5SQ-4GRG-KK00-0XQ ids="/data/xml_tv_ids.txt" raw_can_xml="/data/CANADA.xml" raw_us_xml="/data/USA.xml" -dir=$(dirname "$raw_can_xml") -output="/var/www/html/clean_CANADA_US.xml" +output="/data/clean_CANADA_US.xml" # On crée les filtres pour trouver les channels/programmes qui nous intéressent id_filter=$(awk '{printf "@id='\''%s'\'' or ", $0}' "$ids" | sed 's/ or $//')