From a84c6ee664c15481b92a84b50172c85d37c6191f Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Tue, 13 Jul 2021 13:13:40 +0200 Subject: initiale überweisung diesdas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ansible/mio/bin/mio | 15 +++++++++++++++ ansible/mio/lib/mio.lst | 25 +++++++++++++++++++++++++ ansible/mio/systemd/mio.service | 11 +++++++++++ ansible/mio/systemd/mio.timer | 10 ++++++++++ 4 files changed, 61 insertions(+) create mode 100755 ansible/mio/bin/mio create mode 100644 ansible/mio/lib/mio.lst create mode 100644 ansible/mio/systemd/mio.service create mode 100644 ansible/mio/systemd/mio.timer (limited to 'ansible/mio') diff --git a/ansible/mio/bin/mio b/ansible/mio/bin/mio new file mode 100755 index 0000000..1362c8c --- /dev/null +++ b/ansible/mio/bin/mio @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +YOUTUBE="https://www.youtube.com/watch?v=" +MYTGT="/tmp/mio" +MYMIOCOLL="/var/lib/mio/mio.lst" + +rm -vf "$MYTGT"* + +MYLINES="$(wc -l "$MYMIOCOLL"|awk '{print $1}')" +MYMIO="$(head -n "$((RANDOM%$MYLINES+1))" "$MYMIOCOLL"|tail -n1)" +unset MYLINES MYMIOCOLL +MYMIOTUBE="${YOUTUBE}${MYMIO}" +unset MYMIO +#echo "$MYMIOTUBE" +youtube-dl --write-description --write-info-json -o "/tmp/mio.%(ext)s" "$MYMIOTUBE" diff --git a/ansible/mio/lib/mio.lst b/ansible/mio/lib/mio.lst new file mode 100644 index 0000000..40dc3c6 --- /dev/null +++ b/ansible/mio/lib/mio.lst @@ -0,0 +1,25 @@ +lEJHOzT61I0 +B8p_7Crbsgg +z0CG-vEXeAU +aqQrzPicRks +YnDUcCIAcn4 +h9s_opMmWi8 +-GglKl6RBqk +6UeFcJzVgjk +aIhY_xflSS0 +Q27ksVybWbc +7O0JL1dAH40 +jsh7podkEko +4iZRCfRAGZk +9ugHfj9OT2k +z0CG-vEXeAU +2Pn-rr_oNTs +cNOGSa6YiIo +XRuwCLUK7P4 +vP08CJFgPcw +Xh95JisAGzg +is7LiAyw1_c +U-VIEJGTnTk +aeIpNfjDzPI +Jnu_-jg5Xnc +Ubtcib0Xk2E diff --git a/ansible/mio/systemd/mio.service b/ansible/mio/systemd/mio.service new file mode 100644 index 0000000..4cee4e9 --- /dev/null +++ b/ansible/mio/systemd/mio.service @@ -0,0 +1,11 @@ +[Unit] +Description=Alder Snake de Nävigän vum Eastsides Gewächs +After=network.target dbus.target +Wants=network-online.target + +[Service] +Type = oneshot +RemainAfterExit = no +ExecStart = /usr/local/bin/mio +User=mio +Group=mio diff --git a/ansible/mio/systemd/mio.timer b/ansible/mio/systemd/mio.timer new file mode 100644 index 0000000..66c8ae0 --- /dev/null +++ b/ansible/mio/systemd/mio.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Alder Snake de Nävigän vum Eastsides Gewächs +Wants=network-online.target + +[Timer] +OnCalendar=Mon,Tue,Wed,Thu,Fri 07..18:00:00 +RandomizedDelaySec=900 + +[Install] +WantedBy=timers.target -- cgit v1.2.3