CC-4104: airtime-uninstall should not purge airtime database be default
-on reinstall use the database
This commit is contained in:
parent
e056e5ff01
commit
35d3d63e08
|
@ -149,13 +149,13 @@ if [ "$result" -eq "0" ]; then
|
||||||
rm -f "/etc/airtime/media-monitor.cfg"
|
rm -f "/etc/airtime/media-monitor.cfg"
|
||||||
rm -f "/etc/airtime/pypo.cfg"
|
rm -f "/etc/airtime/pypo.cfg"
|
||||||
elif [ "$result" -eq "1" -a "$reinstall" = "f" ]; then
|
elif [ "$result" -eq "1" -a "$reinstall" = "f" ]; then
|
||||||
echo " * Same version of Airtime already installed!"
|
echo " * Same version of Airtime already installed! Reusing database."
|
||||||
exit 1;
|
nodb='t'
|
||||||
elif [ "$result" -eq "2" ]; then
|
elif [ "$result" -eq "2" ]; then
|
||||||
echo " * Previous version of Airtime already installed..will perform upgrade"
|
echo " * Previous version of Airtime already installed..will perform upgrade."
|
||||||
DO_UPGRADE="1"
|
DO_UPGRADE="1"
|
||||||
elif [ "$result" -eq "3" ]; then
|
elif [ "$result" -eq "3" ]; then
|
||||||
echo " * You require at least Airtime 1.8.0 installed for upgrade"
|
echo " * You require at least Airtime 1.8.0 installed for upgrade."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
from api_clients import api_client
|
from api_clients.api_client import AirtimeApiClient
|
||||||
|
|
||||||
def generate_liquidsoap_config(ss):
|
def generate_liquidsoap_config(ss):
|
||||||
data = ss['msg']
|
data = ss['msg']
|
||||||
|
@ -9,22 +9,22 @@ def generate_liquidsoap_config(ss):
|
||||||
fh.write("# THIS FILE IS AUTO GENERATED. DO NOT CHANGE!! #\n")
|
fh.write("# THIS FILE IS AUTO GENERATED. DO NOT CHANGE!! #\n")
|
||||||
fh.write("################################################\n")
|
fh.write("################################################\n")
|
||||||
for d in data:
|
for d in data:
|
||||||
|
|
||||||
|
key = d['keyname']
|
||||||
|
|
||||||
str_buffer = d[u'keyname'] + " = "
|
str_buffer = d[u'keyname'] + " = "
|
||||||
if(d[u'type'] == 'string'):
|
if(d[u'type'] == 'string'):
|
||||||
temp = d[u'value']
|
val = '"%s"' % d['value']
|
||||||
str_buffer += '"%s"' % temp
|
|
||||||
else:
|
else:
|
||||||
temp = d[u'value']
|
val = d[u'value']
|
||||||
if(temp == ""):
|
val = val if len(val) > 0 else "0"
|
||||||
temp = "0"
|
str_buffer = "%s = %s\n" % (key, val)
|
||||||
str_buffer += temp
|
fh.write(str_buffer)
|
||||||
str_buffer += "\n"
|
|
||||||
fh.write(api_client.encode_to(str_buffer))
|
|
||||||
fh.write('log_file = "/var/log/airtime/pypo-liquidsoap/<script>.log"\n')
|
fh.write('log_file = "/var/log/airtime/pypo-liquidsoap/<script>.log"\n')
|
||||||
fh.close()
|
fh.close()
|
||||||
|
|
||||||
logging.basicConfig(format='%(message)s')
|
logging.basicConfig(format='%(message)s')
|
||||||
ac = api_client(logging.getLogger())
|
ac = AirtimeApiClient(logging.getLogger())
|
||||||
ss = ac.get_stream_setting()
|
ss = ac.get_stream_setting()
|
||||||
|
|
||||||
if ss is not None:
|
if ss is not None:
|
||||||
|
|
Loading…
Reference in New Issue