summaryrefslogtreecommitdiffstats
path: root/skripti/ž
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-06-13 19:50:20 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-06-13 19:50:20 +0200
commit23d0d97c8e41bfad0c5f5500c25237ec3440f6e9 (patch)
tree8e40951eadebac0f181e46d5de1230c835709091 /skripti/ž
parentskripti (diff)
downloadr-23d0d97c8e41bfad0c5f5500c25237ec3440f6e9.tar
r-23d0d97c8e41bfad0c5f5500c25237ec3440f6e9.tar.gz
r-23d0d97c8e41bfad0c5f5500c25237ec3440f6e9.tar.bz2
r-23d0d97c8e41bfad0c5f5500c25237ec3440f6e9.tar.lz
r-23d0d97c8e41bfad0c5f5500c25237ec3440f6e9.tar.xz
r-23d0d97c8e41bfad0c5f5500c25237ec3440f6e9.tar.zst
r-23d0d97c8e41bfad0c5f5500c25237ec3440f6e9.zip
Diffstat (limited to '')
-rw-r--r--skripti/ž36
1 files changed, 0 insertions, 36 deletions
diff --git a/skripti/ž b/skripti/ž
deleted file mode 100644
index d18de36..0000000
--- a/skripti/ž
+++ /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