diff --git a/Dockerfile b/Dockerfile index 2f00321..4e28851 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,8 +15,9 @@ COPY ices.xml.jinja . COPY next_song.py /opt COPY yt_sync.py /opt +COPY ultrasync.sh /opt -RUN chmod +x /opt/yt_sync.py /opt/next_song.py +RUN chmod +x /opt/yt_sync.py /opt/next_song.py /opt/ultrasync.sh RUN mkdir -p /songs /jingles /var/log/icecast @@ -30,4 +31,4 @@ RUN chown -R zambla:zambla /usr/share/icecast2 COPY entrypoint.sh /opt/entrypoint.sh RUN chmod +x /opt/entrypoint.sh -ENTRYPOINT [ "/opt/entrypoint.sh" ] \ No newline at end of file +ENTRYPOINT [ "/opt/entrypoint.sh" ] diff --git a/entrypoint.sh b/entrypoint.sh index 76e1c5d..fe94e9a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,10 +11,9 @@ pass_gen="python3 -c 'import secrets, string; print(\"\".join((secrets.choice(st export source_username=$(eval $pass_gen) export source_password=$(eval $pass_gen) -pip install youtube-dl - j2 ices.xml.jinja > ices.xml j2 icecast.xml.jinja > icecast.xml runuser -l zambla -c 'icecast2 -c /config/icecast.xml &' +runuser -l zambla -c '/opt/ultrasync.sh &' runuser -l zambla -c 'ices2 /config/ices.xml' diff --git a/ultrasync.sh b/ultrasync.sh new file mode 100644 index 0000000..b4f2323 --- /dev/null +++ b/ultrasync.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +while true; do + pip3 install -U youtube_dl --user + /opt/yt_sync.py + sleep 10m +done