Add random radio channel change script cronjob. - annna - Annna the nice friendly bot.
(HTM) git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit 6ade0074dec77454edc9bd00cfdab04446ee324d
(DIR) parent c07d9beb574fb17beae9ceed3c6f0369180b7681
(HTM) Author: Annna Robert-Houdin <annna@bitreich.org>
Date: Wed, 31 Dec 2025 16:01:52 +0100
Add random radio channel change script cronjob.
Diffstat:
A modules/radio/radio-random-channel… | 15 +++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/modules/radio/radio-random-channel-cronjob.sh b/modules/radio/radio-random-channel-cronjob.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+randomuri="$(curl -s gophers://bitreich.org/1/radio/lawn/random \
+ | head -n 1 \
+ | cut -f 2 \
+ | cut -d':' -f 2-)"
+# Go into playing, so we can crop.
+mpc play >/dev/null 2>&1
+# Be sure there is only one thing in the playlist.
+mpc crop >/dev/null 2>&1
+# Add new randum radio at position 2.
+printf "%s\n" "${randomuri}" | mpc add >/dev/null 2>&1
+# Fade to new radio.
+mpc next >/dev/null 2>&1
+