liquidsoap_prepare_terminate.py 443 B

1234567891011121314151617181920
  1. from configobj import ConfigObj
  2. import telnetlib
  3. import sys
  4. try:
  5. config = ConfigObj('/etc/airtime/airtime.conf')
  6. LS_HOST = config['pypo']['ls_host']
  7. LS_PORT = config['pypo']['ls_port']
  8. tn = telnetlib.Telnet(LS_HOST, LS_PORT)
  9. tn.write("master_harbor.stop\n")
  10. tn.write("live_dj_harbor.stop\n")
  11. tn.write('exit\n')
  12. tn.read_all()
  13. except Exception, e:
  14. print('Error loading config file: %s', e)
  15. sys.exit()