From 23d0d97c8e41bfad0c5f5500c25237ec3440f6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Thu, 13 Jun 2024 19:50:20 +0200 Subject: vremenska postaja --- "skripti/\305\276" | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 "skripti/\305\276" (limited to 'skripti/ž') diff --git "a/skripti/\305\276" "b/skripti/\305\276" deleted file mode 100644 index d18de36..0000000 --- "a/skripti/\305\276" +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# $1 naj bo icecast host kruljo.radiostudent.si -# $2 naj bo icecast http port 8000 -# $3 naj bo icecast endpoint /ehiq -# $4 naj bo končnica datotek .mp3 -# v CWD delam imenike in datoteke in sem glede tega kompatibilen z earhornom: -# Posnetek 2024/06/03/202136.mp3 se začne 2024-06-03T20:21:36 vedno UTC. -# Posnetkov ne splittam na uro. Posnetek se splitta le takrat, ko se zgodi napaka (stream crkne) -- takrat začnem pisati v novo datoteko -# požvižgam se na vsebino datotek. zame so to le bajti. v tem nisem earhornski. -host=$1 -port=$2 -endpoint=$3 -kon=$4 -mistakes=0 -set -xeuo pipefail -while : -do - filename=`date --utc +%Y/%m/%d/%H%m%S$kon` - mkdir -p `cut -d/ -f1-3 <<<$filename` - start=$SECONDS - set +e - nc $host $port <<<"GET $endpoint HTTP/1.0"$'\r\n\r' > $filename - koda=$? - set -e - echo TCP PREKINJEN! ZAČENJAM NOV POSNETEK! IZHODNA KODA nc je $koda, datum je `date` - if [ $(($SECONDS-$start)) -lt 300 ] - then - mistakes=$(($mistakes+1)) - if [ $mistakes -gt 3 ] - then - sleep $((2**($mistakes-3))) - fi - else - mistakes=0 - fi -done -- cgit v1.2.3