l radio: fix listener counting
This commit is contained in:
parent
6fb30b6ace
commit
0382e74b12
@ -225,7 +225,7 @@ in {
|
|||||||
${pkgs.mpc_cli}/bin/mpc idle player > /dev/null
|
${pkgs.mpc_cli}/bin/mpc idle player > /dev/null
|
||||||
${pkgs.mpc_cli}/bin/mpc current -f %file%
|
${pkgs.mpc_cli}/bin/mpc current -f %file%
|
||||||
done | while read track; do
|
done | while read track; do
|
||||||
listeners=$(${pkgs.iproute}/bin/ss -Hno state established 'sport = :8000' | grep '^mptcp' | wc -l)
|
listeners=$(${pkgs.iproute}/bin/ss -Hno state established 'sport = :8000' | grep '^tcp' | wc -l)
|
||||||
echo "$(date -Is)" "$track" | tee -a "$HISTORY_FILE"
|
echo "$(date -Is)" "$track" | tee -a "$HISTORY_FILE"
|
||||||
echo "$(tail -$LIMIT "$HISTORY_FILE")" > "$HISTORY_FILE"
|
echo "$(tail -$LIMIT "$HISTORY_FILE")" > "$HISTORY_FILE"
|
||||||
${set_irc_topic} "playing: $track listeners: $listeners"
|
${set_irc_topic} "playing: $track listeners: $listeners"
|
||||||
|
Loading…
Reference in New Issue
Block a user