versione iniziale

This commit is contained in:
boyska 2023-04-06 12:46:49 +02:00
commit a63865a108
3 changed files with 45 additions and 0 deletions

4
README.md Normal file
View file

@ -0,0 +1,4 @@
L'imbruttino è lo streaming alpha, comanda esso, fa brutto all'abbozzino.
Il quale abbozzino, per l'appunto, abbozza, e trova il coraggio di streammare solo quando l'imbruttino muore.

View file

@ -0,0 +1,29 @@
#!/bin/bash
set -eu
checkFile=/home/rorserver/inibisci-streaming
# in minutes
waitingTime=3
service=liquidsoap@main.service
uptime="$(cut -d. -f1 < /proc/uptime)"
sleepTime="$((waitingTime * 60 - uptime))"
if [[ "$sleepTime" -gt 0 ]]; then
sleep "$sleepTime"
fi
while true
do
if [ -n "$(find "${checkFile}" -type f -mmin "-${waitingTime}" 2> /dev/null)" ]
then
echo "stop"
systemctl stop --no-block "${service}" || true
else
echo "start"
systemctl start --no-block "${service}" || true
fi
sleep 1m
done

View file

@ -0,0 +1,12 @@
#!/bin/sh
set -eu
while true
do
if ! ssh ciocchino.hidden touch inibisci-streaming
then
echo "Error!"
fi
sleep 30
done