From 25e947c8bf6379667211862fccf3b12f65722be6 Mon Sep 17 00:00:00 2001
From: jo <ljonas@riseup.net>
Date: Sun, 3 Oct 2021 16:12:04 +0200
Subject: [PATCH] Rename airtime-liquidsoap to libretime-liquidsoap

BREAKING:
sudo rm -f \
  /etc/logrotate.d/airtime-liquidsoap
---
 install                                                       | 2 +-
 python_apps/pypo/liquidsoap/__main__.py                       | 2 +-
 .../{airtime-liquidsoap.logrotate => logrotate.conf}          | 2 +-
 python_apps/pypo/pypo/pypofetch.py                            | 2 +-
 utils/airtime-test-soundcard.py                               | 4 ++--
 utils/airtime-test-stream.py                                  | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
 rename python_apps/pypo/liquidsoap/{airtime-liquidsoap.logrotate => logrotate.conf} (65%)

diff --git a/install b/install
index bc73d5388..007d97bf5 100755
--- a/install
+++ b/install
@@ -1015,7 +1015,7 @@ if [ ! -d /var/log/airtime ]; then
 
   verbose "\n * Copying logrotate files..."
   loudCmd "cp ${AIRTIMEROOT}/legacy/build/airtime-php.logrotate /etc/logrotate.d/airtime-php"
-  loudCmd "cp ${AIRTIMEROOT}/python_apps/pypo/liquidsoap/airtime-liquidsoap.logrotate /etc/logrotate.d/airtime-liquidsoap"
+  loudCmd "cp ${AIRTIMEROOT}/python_apps/pypo/liquidsoap/logrotate.conf /etc/logrotate.d/libretime-liquidsoap"
 fi
 
 verbose "\n * Installing API client..."
diff --git a/python_apps/pypo/liquidsoap/__main__.py b/python_apps/pypo/liquidsoap/__main__.py
index e25e07aab..77f1b8259 100644
--- a/python_apps/pypo/liquidsoap/__main__.py
+++ b/python_apps/pypo/liquidsoap/__main__.py
@@ -36,7 +36,7 @@ def run():
     )
     exec_args = [
         "/usr/bin/liquidsoap",
-        "airtime-liquidsoap",
+        "libretime-liquidsoap",
         script_path,
         "--verbose",
         "-f",
diff --git a/python_apps/pypo/liquidsoap/airtime-liquidsoap.logrotate b/python_apps/pypo/liquidsoap/logrotate.conf
similarity index 65%
rename from python_apps/pypo/liquidsoap/airtime-liquidsoap.logrotate
rename to python_apps/pypo/liquidsoap/logrotate.conf
index fd340722b..620a818cb 100644
--- a/python_apps/pypo/liquidsoap/airtime-liquidsoap.logrotate
+++ b/python_apps/pypo/liquidsoap/logrotate.conf
@@ -6,6 +6,6 @@
   notifempty
   sharedscripts
   postrotate
-    systemctl kill --signal=SIGUSR1 airtime-liquidsoap >/dev/null 2>&1 || true
+    systemctl kill --signal=SIGUSR1 libretime-liquidsoap >/dev/null 2>&1 || true
   endscript
 }
diff --git a/python_apps/pypo/pypo/pypofetch.py b/python_apps/pypo/pypo/pypofetch.py
index dc2cb5c85..a57722a0b 100644
--- a/python_apps/pypo/pypo/pypofetch.py
+++ b/python_apps/pypo/pypo/pypofetch.py
@@ -193,7 +193,7 @@ class PypoFetch(Thread):
 
             self.logger.info("Restarting Liquidsoap")
             subprocess.call(
-                "kill -9 `pidof airtime-liquidsoap`", shell=True, close_fds=True
+                "kill -9 `pidof libretime-liquidsoap`", shell=True, close_fds=True
             )
 
             # Wait here and poll Liquidsoap until it has started up
diff --git a/utils/airtime-test-soundcard.py b/utils/airtime-test-soundcard.py
index d9345b107..0da138f25 100644
--- a/utils/airtime-test-soundcard.py
+++ b/utils/airtime-test-soundcard.py
@@ -30,9 +30,9 @@ def find_liquidsoap_binary():
     the location of this binary.
     """
 
-    rv = subprocess.call("which airtime-liquidsoap > /dev/null", shell=True)
+    rv = subprocess.call("which libretime-liquidsoap > /dev/null", shell=True)
     if rv == 0:
-        return "airtime-liquidsoap"
+        return "libretime-liquidsoap"
 
     return None
 
diff --git a/utils/airtime-test-stream.py b/utils/airtime-test-stream.py
index 0bf6a25ce..977d79b03 100644
--- a/utils/airtime-test-stream.py
+++ b/utils/airtime-test-stream.py
@@ -30,7 +30,7 @@ def printUsage():
 
 def find_liquidsoap_binary():
     """
-    With libretime 3.0 we are no longer depending upon the airtime-liquidsoap binary
+    With libretime 3.0 we are no longer depending upon the libretime-liquidsoap binary
     but use a generic install of liquidsoap. This takes care of checking if it is on the
     path and will lead to an error otherwise.
     """