diff options
author | lassulus <git@lassul.us> | 2023-09-03 11:59:53 +0200 |
---|---|---|
committer | lassulus <git@lassul.us> | 2023-09-03 11:59:53 +0200 |
commit | 45c3e165c96efa0148ddedffd50f508d7dae6093 (patch) | |
tree | 774ba8bd4135f16e04c02f2312005727205078eb /lass/2configs/services/radio | |
parent | 541cfbe3a2544ec74cee6c9b24b1a86051688414 (diff) |
l radio: add watcher
Diffstat (limited to 'lass/2configs/services/radio')
-rw-r--r-- | lass/2configs/services/radio/default.nix | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lass/2configs/services/radio/default.nix b/lass/2configs/services/radio/default.nix index 5accfe360..5a10b5578 100644 --- a/lass/2configs/services/radio/default.nix +++ b/lass/2configs/services/radio/default.nix @@ -104,6 +104,22 @@ in { print_current ]; + + systemd.services.radio_watcher = { + wantedBy = [ "multi-user.target" ]; + after = [ "radio.service" ]; + serviceConfig = { + ExecStart = pkgs.writers.writeDash "radio_watcher" '' + set -efux + while :; do + ${pkgs.curl}/bin/curl -Ss http://localhost:8000/radio.ogg -o /dev/null + ${pkgs.systemd}/bin/systemctl restart radio + sleep 60 + done + ''; + }; + }; + services.liquidsoap.streams.radio = ./radio.liq; systemd.services.radio = { environment = { @@ -124,6 +140,7 @@ in { }; path = [ pkgs.yt-dlp + pkgs.bubblewrap ]; serviceConfig.User = lib.mkForce "radio"; }; @@ -163,6 +180,7 @@ in { filter.INPUT.rules = [ { predicate = "-p tcp --dport 8000"; target = "ACCEPT"; } { predicate = "-i retiolum -p tcp --dport 8001"; target = "ACCEPT"; } + { predicate = "-i retiolum -p tcp --dport 8002"; target = "ACCEPT"; } ]; }; }; |