sintonia/python_apps/pypo/liquidsoap/liquidsoap_prepare_terminate.py
jo 01fbd1e8b9 Add isort pre-commit hook
Sort import statement in python files

See https://github.com/PyCQA/isort
2021-06-05 00:39:35 +02:00

19 lines
452 B
Python

import sys
import telnetlib
from configobj import ConfigObj
try:
config = ConfigObj("/etc/airtime/airtime.conf")
LS_HOST = config["pypo"]["ls_host"]
LS_PORT = config["pypo"]["ls_port"]
tn = telnetlib.Telnet(LS_HOST, LS_PORT)
tn.write("master_harbor.stop\n")
tn.write("live_dj_harbor.stop\n")
tn.write("exit\n")
tn.read_all()
except Exception as e:
print("Error loading config file: {}".format(e))
sys.exit()