Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
41eeefe427
21 changed files with 153 additions and 87 deletions
|
@ -18,7 +18,11 @@ class NowplayingController extends Zend_Controller_Action
|
||||||
$baseUrl = $request->getBaseUrl();
|
$baseUrl = $request->getBaseUrl();
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.min.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.min.js','text/javascript');
|
||||||
|
|
||||||
|
//nowplayingdatagrid.js requires this variable, so that datePicker widget can be offset to server time instead of client time
|
||||||
|
$this->view->headScript()->appendScript("var timezoneOffset = ".date("Z")."; //in seconds");
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowplayingdatagrid.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowplayingdatagrid.js','text/javascript');
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowview.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowview.js','text/javascript');
|
||||||
|
|
||||||
$refer_sses = new Zend_Session_Namespace('referrer');
|
$refer_sses = new Zend_Session_Namespace('referrer');
|
||||||
|
@ -104,7 +108,11 @@ class NowplayingController extends Zend_Controller_Action
|
||||||
$baseUrl = $request->getBaseUrl();
|
$baseUrl = $request->getBaseUrl();
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.min.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.min.js','text/javascript');
|
||||||
|
|
||||||
|
//nowplayingdatagrid.js requires this variable, so that datePicker widget can be offset to server time instead of client time
|
||||||
|
$this->view->headScript()->appendScript("var timezoneOffset = ".date("Z")."; //in seconds");
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowplayingdatagrid.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowplayingdatagrid.js','text/javascript');
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/dayview.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/dayview.js','text/javascript');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,6 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
|
|
||||||
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
|
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
|
||||||
}
|
}
|
||||||
var_dump($form->getValue('icecast_vorbis_metadata'));
|
|
||||||
if(!$error){
|
if(!$error){
|
||||||
Application_Model_StreamSetting::setStreamSetting($values);
|
Application_Model_StreamSetting::setStreamSetting($values);
|
||||||
$data = array();
|
$data = array();
|
||||||
|
|
|
@ -46,7 +46,11 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/fullcalendar/fullcalendar.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/fullcalendar/fullcalendar.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/timepicker/jquery.ui.timepicker-0.0.6.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/timepicker/jquery.ui.timepicker-0.0.6.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/colorpicker/js/colorpicker.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/colorpicker/js/colorpicker.js','text/javascript');
|
||||||
|
|
||||||
|
//full-calendar-functions.js requires this variable, so that datePicker widget can be offset to server time instead of client time
|
||||||
|
$this->view->headScript()->appendScript("var timezoneOffset = ".date("Z")."; //in seconds");
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/full-calendar-functions.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/full-calendar-functions.js','text/javascript');
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/add-show.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/add-show.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/schedule.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/schedule.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/meioMask/jquery.meio.mask.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/meioMask/jquery.meio.mask.js','text/javascript');
|
||||||
|
|
|
@ -28,7 +28,7 @@ class Application_Form_StreamSetting extends Zend_Form
|
||||||
}
|
}
|
||||||
|
|
||||||
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
|
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
|
||||||
$icecast_vorbis_metadata->setLabel('Icecast Vorbis Meatadata')
|
$icecast_vorbis_metadata->setLabel('Icecast Vorbis Metadata')
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
->setValue(($setting['icecast_vorbis_metadata'] == "true")?1:0)
|
->setValue(($setting['icecast_vorbis_metadata'] == "true")?1:0)
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
|
|
|
@ -178,13 +178,27 @@ class Application_Model_Show {
|
||||||
* Sunday are removed.
|
* Sunday are removed.
|
||||||
*
|
*
|
||||||
* @param array p_uncheckedDays
|
* @param array p_uncheckedDays
|
||||||
* An array specifying which days should be removed.
|
* An array specifying which days should be removed. (in the local timezone)
|
||||||
*/
|
*/
|
||||||
public function removeUncheckedDaysInstances($p_uncheckedDays)
|
public function removeUncheckedDaysInstances($p_uncheckedDays)
|
||||||
{
|
{
|
||||||
global $CC_DBC;
|
global $CC_DBC;
|
||||||
|
|
||||||
$uncheckedDaysImploded = implode(",", $p_uncheckedDays);
|
//need to convert local doftw to UTC doftw (change made for 2.0 since shows are stored in UTC)
|
||||||
|
$daysRemovedUTC = array();
|
||||||
|
|
||||||
|
$showDays = CcShowDaysQuery::create()
|
||||||
|
->filterByDbShowId($this->getId())
|
||||||
|
->find();
|
||||||
|
foreach($showDays as $showDay) {
|
||||||
|
if (in_array($showDay->getDbDay(), $p_uncheckedDays)) {
|
||||||
|
$startDay = new DateTime("{$showDay->getDbFirstShow()} {$showDay->getDbStartTime()}", new DateTimeZone($showDay->getDbTimezone()));
|
||||||
|
$startDay->setTimezone(new DateTimeZone("UTC"));
|
||||||
|
$daysRemovedUTC[] = $startDay->format("w");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$uncheckedDaysImploded = implode(",", $daysRemovedUTC);
|
||||||
$showId = $this->getId();
|
$showId = $this->getId();
|
||||||
|
|
||||||
$timestamp = gmdate("Y-m-d H:i:s");
|
$timestamp = gmdate("Y-m-d H:i:s");
|
||||||
|
@ -194,9 +208,6 @@ class Application_Model_Show {
|
||||||
." AND starts > TIMESTAMP '$timestamp'"
|
." AND starts > TIMESTAMP '$timestamp'"
|
||||||
." AND show_id = $showId";
|
." AND show_id = $showId";
|
||||||
|
|
||||||
Logging::log("sql for removing unchecked days");
|
|
||||||
Logging::log($sql);
|
|
||||||
|
|
||||||
$CC_DBC->query($sql);
|
$CC_DBC->query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -797,6 +808,7 @@ class Application_Model_Show {
|
||||||
$daysRemoved = array_diff($showDaysArray, $p_data['add_show_day_check']);
|
$daysRemoved = array_diff($showDaysArray, $p_data['add_show_day_check']);
|
||||||
|
|
||||||
if (count($daysRemoved) > 0){
|
if (count($daysRemoved) > 0){
|
||||||
|
|
||||||
$this->removeUncheckedDaysInstances($daysRemoved);
|
$this->removeUncheckedDaysInstances($daysRemoved);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,22 @@ class Application_Model_StreamSetting {
|
||||||
return $ids;
|
return $ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Retruns only global data as array*/
|
||||||
|
public static function getGlobalData(){
|
||||||
|
global $CC_DBC;
|
||||||
|
$sql = "SELECT * "
|
||||||
|
."FROM cc_stream_setting "
|
||||||
|
."WHERE keyname IN ('output_sound_device', 'icecast_vorbis_metadata')";
|
||||||
|
|
||||||
|
$rows = $CC_DBC->getAll($sql);
|
||||||
|
$data = array();
|
||||||
|
|
||||||
|
foreach($rows as $row){
|
||||||
|
$data[$row["keyname"]] = $row["value"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
/* Returns all information related to a specific stream. An example
|
/* Returns all information related to a specific stream. An example
|
||||||
* of a stream id is 's1' or 's2'. */
|
* of a stream id is 's1' or 's2'. */
|
||||||
public static function getStreamData($p_streamId){
|
public static function getStreamData($p_streamId){
|
||||||
|
@ -66,7 +82,6 @@ class Application_Model_StreamSetting {
|
||||||
$CC_DBC->query($sql);
|
$CC_DBC->query($sql);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
var_dump($key);
|
|
||||||
$temp = explode('_', $key);
|
$temp = explode('_', $key);
|
||||||
$prefix = $temp[0];
|
$prefix = $temp[0];
|
||||||
foreach($d as $k=>$v){
|
foreach($d as $k=>$v){
|
||||||
|
|
|
@ -6,3 +6,16 @@ $(document).ready(function() {
|
||||||
savePanelSpace: true
|
savePanelSpace: true
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function adjustDateToServerDate(date, serverTimezoneOffset){
|
||||||
|
//date object stores time in the browser's localtime. We need to artificially shift
|
||||||
|
//it to
|
||||||
|
var timezoneOffset = date.getTimezoneOffset()*60*1000;
|
||||||
|
|
||||||
|
date.setTime(date.getTime() + timezoneOffset + serverTimezoneOffset*1000);
|
||||||
|
|
||||||
|
/* date object has been shifted to artificial UTC time. Now let's
|
||||||
|
* shift it to the server's timezone */
|
||||||
|
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
|
@ -204,7 +204,7 @@ $(document).ready(function() {
|
||||||
$("#datepicker").datepicker({
|
$("#datepicker").datepicker({
|
||||||
onSelect: function(dateText, inst)
|
onSelect: function(dateText, inst)
|
||||||
{ getData();}});
|
{ getData();}});
|
||||||
$("#datepicker").datepicker("setDate", new Date());
|
$("#datepicker").datepicker("setDate", adjustDateToServerDate(new Date(), timezoneOffset));
|
||||||
} else {
|
} else {
|
||||||
$('#day_view').click(function(){redirect('/Nowplaying/day-view')});
|
$('#day_view').click(function(){redirect('/Nowplaying/day-view')});
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ function endDpSelect(dateText, inst) {
|
||||||
time = dateText.split("-");
|
time = dateText.split("-");
|
||||||
date = new Date(time[0], time[1] - 1, time[2]);
|
date = new Date(time[0], time[1] - 1, time[2]);
|
||||||
|
|
||||||
//$("#add_show_start_date").datepicker( "option", "maxDate", date);
|
|
||||||
if (inst.input)
|
if (inst.input)
|
||||||
inst.input.trigger('change');
|
inst.input.trigger('change');
|
||||||
}
|
}
|
||||||
|
@ -32,7 +31,7 @@ function createDateInput(el, onSelect) {
|
||||||
var date;
|
var date;
|
||||||
|
|
||||||
el.datepicker({
|
el.datepicker({
|
||||||
minDate: new Date(),
|
minDate: adjustDateToServerDate(new Date(), timezoneOffset),
|
||||||
onSelect: onSelect,
|
onSelect: onSelect,
|
||||||
dateFormat: 'yy-mm-dd'
|
dateFormat: 'yy-mm-dd'
|
||||||
});
|
});
|
||||||
|
@ -188,7 +187,7 @@ function setAddShowEvents() {
|
||||||
});
|
});
|
||||||
|
|
||||||
form.find('input[name^="add_show_rebroadcast_date_absolute"]').datepicker({
|
form.find('input[name^="add_show_rebroadcast_date_absolute"]').datepicker({
|
||||||
minDate: new Date(),
|
minDate: adjustDateToServerDate(new Date(), timezoneOffset),
|
||||||
dateFormat: 'yy-mm-dd'
|
dateFormat: 'yy-mm-dd'
|
||||||
});
|
});
|
||||||
form.find('input[name^="add_show_rebroadcast_time"]').timepicker({
|
form.find('input[name^="add_show_rebroadcast_time"]').timepicker({
|
||||||
|
|
|
@ -75,19 +75,6 @@ function makeTimeStamp(date){
|
||||||
return timestamp;
|
return timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
function adjustDateToServerDate(date, serverTimezoneOffset){
|
|
||||||
//date object stores time in the browser's localtime. We need to artificially shift
|
|
||||||
//it to
|
|
||||||
var timezoneOffset = date.getTimezoneOffset()*60*1000;
|
|
||||||
|
|
||||||
date.setTime(date.getTime() + timezoneOffset + serverTimezoneOffset*1000);
|
|
||||||
|
|
||||||
/* date object has been shifted to artificial UTC time. Now let's
|
|
||||||
* shift it to the server's timezone */
|
|
||||||
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
function pad(number, length) {
|
function pad(number, length) {
|
||||||
var str = '' + number;
|
var str = '' + number;
|
||||||
while (str.length < length) {
|
while (str.length < length) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ martin@Thinkpad-T410:~/workspace/airtime/airtime_mvc/public/js/fullcalendar$ dif
|
||||||
+})(jQuery);
|
+})(jQuery);
|
||||||
|
|
||||||
|
|
||||||
adjustDateToServerDate() function is defined in "js/airtime/schedule/full-calendar-functions.js"
|
adjustDateToServerDate() function is defined in "js/airtime/common/common.js"
|
||||||
|
|
||||||
Please make this change before updating!!!
|
Please make this change before updating!!!
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,10 @@ if [ `whoami` != 'root' ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export INSTALL_PYPO=1
|
||||||
|
export INSTALL_MEDIA_MONITOR=1
|
||||||
|
export INSTALL_SHOW_RECORDER=1
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
DEB=$(dpkg -s airtime 2> /dev/null | grep Status)
|
DEB=$(dpkg -s airtime 2> /dev/null | grep Status)
|
||||||
set -e
|
set -e
|
||||||
|
@ -62,13 +66,14 @@ fi
|
||||||
$SCRIPTPATH/include/airtime-copy-files.sh
|
$SCRIPTPATH/include/airtime-copy-files.sh
|
||||||
$SCRIPTPATH/include/airtime-initialize.sh $@
|
$SCRIPTPATH/include/airtime-initialize.sh $@
|
||||||
|
|
||||||
|
#deactivate virtualenv
|
||||||
|
deactivate
|
||||||
|
|
||||||
/usr/lib/airtime/utils/rabbitmq-update-pid.sh
|
/usr/lib/airtime/utils/rabbitmq-update-pid.sh
|
||||||
|
|
||||||
echo -e "\n*** Verifying your system environment, running airtime-check-system ***"
|
echo -e "\n*** Verifying your system environment, running airtime-check-system ***"
|
||||||
sleep 10
|
sleep 10
|
||||||
airtime-check-system
|
airtime-check-system
|
||||||
|
|
||||||
#deactivate virtualenv
|
|
||||||
deactivate
|
|
||||||
|
|
||||||
echo -e "\n******************************* Install Complete *******************************"
|
echo -e "\n******************************* Install Complete *******************************"
|
||||||
|
|
|
@ -39,25 +39,12 @@ if [ ! -e /etc/airtime/airtime.conf ]; then
|
||||||
cp $AIRTIMEROOT/airtime_mvc/build/airtime.conf /etc/airtime
|
cp $AIRTIMEROOT/airtime_mvc/build/airtime.conf /etc/airtime
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e /etc/airtime/api_client.cfg ]; then
|
echo "* Creating /etc/airtime"
|
||||||
cp $AIRTIMEROOT/python_apps/api_clients/api_client.cfg /etc/airtime
|
mkdir -p /etc/monit/conf.d/
|
||||||
|
if [ ! -e /etc/monit/conf.d/monit-airtime-generic.cfg ]; then
|
||||||
|
cp $AIRTIMEROOT/python_apps/monit/monit-airtime-generic.cfg /etc/monit/conf.d/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e /etc/airtime/recorder.cfg ]; then
|
|
||||||
cp $AIRTIMEROOT/python_apps/show-recorder/recorder.cfg /etc/airtime
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e /etc/airtime/media-monitor.cfg ]; then
|
|
||||||
cp $AIRTIMEROOT/python_apps/media-monitor/media-monitor.cfg /etc/airtime
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e /etc/airtime/pypo.cfg ]; then
|
|
||||||
cp $AIRTIMEROOT/python_apps/pypo/pypo.cfg /etc/airtime
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e /etc/airtime/liquidsoap.cfg ]; then
|
|
||||||
cp $AIRTIMEROOT/python_apps/pypo/liquidsoap_scripts/liquidsoap.cfg /etc/airtime
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "* Creating /etc/cron.d/airtime-crons"
|
echo "* Creating /etc/cron.d/airtime-crons"
|
||||||
HOUR=$(($RANDOM%24))
|
HOUR=$(($RANDOM%24))
|
||||||
|
@ -68,11 +55,20 @@ echo "$MIN $HOUR * * * root /usr/lib/airtime/utils/phone_home_stat" > /etc/cron.
|
||||||
#. ${virtualenv_bin}activate
|
#. ${virtualenv_bin}activate
|
||||||
|
|
||||||
echo "* Creating /usr/lib/airtime"
|
echo "* Creating /usr/lib/airtime"
|
||||||
python $AIRTIMEROOT/python_apps/api_clients/install/api_client_install.py
|
|
||||||
python $AIRTIMEROOT/python_apps/pypo/install/pypo-copy-files.py
|
|
||||||
python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-copy-files.py
|
|
||||||
python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-copy-files.py
|
|
||||||
|
|
||||||
|
if [ "$INSTALL_PYPO" -eq "1" -o "$INSTALL_MEDIA_MONITOR" -eq "1" -o "$INSTALL_SHOW_RECORDER" -eq "1" ]; then
|
||||||
|
python $AIRTIMEROOT/python_apps/api_clients/install/api_client_install.py
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$INSTALL_PYPO" -eq "1" ]; then
|
||||||
|
python $AIRTIMEROOT/python_apps/pypo/install/pypo-copy-files.py
|
||||||
|
fi
|
||||||
|
if [ "$INSTALL_MEDIA_MONITOR" -eq "1" ]; then
|
||||||
|
python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-copy-files.py
|
||||||
|
fi
|
||||||
|
if [ "$INSTALL_SHOW_RECORDER" -eq "1" ]; then
|
||||||
|
python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-copy-files.py
|
||||||
|
fi
|
||||||
cp -R $AIRTIMEROOT/utils /usr/lib/airtime
|
cp -R $AIRTIMEROOT/utils /usr/lib/airtime
|
||||||
|
|
||||||
echo "* Creating symbolic links in /usr/bin"
|
echo "* Creating symbolic links in /usr/bin"
|
||||||
|
|
|
@ -30,9 +30,15 @@ if [ "$DO_UPGRADE" -eq "0" ]; then
|
||||||
fi
|
fi
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
python $AIRTIMEROOT/python_apps/pypo/install/pypo-initialize.py
|
if [ "$INSTALL_PYPO" -eq "1" ]; then
|
||||||
python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-initialize.py
|
python $AIRTIMEROOT/python_apps/pypo/install/pypo-initialize.py
|
||||||
python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-initialize.py
|
fi
|
||||||
|
if [ "$INSTALL_MEDIA_MONITOR" -eq "1" ]; then
|
||||||
|
python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-initialize.py
|
||||||
|
fi
|
||||||
|
if [ "$INSTALL_SHOW_RECORDER" -eq "1" ]; then
|
||||||
|
python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-initialize.py
|
||||||
|
fi
|
||||||
|
|
||||||
# Start monit if it is not running, or restart if it is.
|
# Start monit if it is not running, or restart if it is.
|
||||||
# Need to ensure monit is running before Airtime daemons are run. This is
|
# Need to ensure monit is running before Airtime daemons are run. This is
|
||||||
|
@ -45,9 +51,16 @@ python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-initialize.py
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
monit monitor airtime-media-monitor
|
if [ "$INSTALL_PYPO" -eq "1" ]; then
|
||||||
monit monitor airtime-liquidsoap
|
monit monitor airtime-playout
|
||||||
monit monitor airtime-playout
|
monit monitor airtime-liquidsoap
|
||||||
monit monitor airtime-show-recorder
|
fi
|
||||||
|
if [ "$INSTALL_MEDIA_MONITOR" -eq "1" ]; then
|
||||||
|
monit monitor airtime-media-monitor
|
||||||
|
fi
|
||||||
|
if [ "$INSTALL_SHOW_RECORDER" -eq "1" ]; then
|
||||||
|
monit monitor airtime-show-recorder
|
||||||
|
fi
|
||||||
|
|
||||||
monit monitor rabbitmq-server
|
monit monitor rabbitmq-server
|
||||||
set -e
|
set -e
|
||||||
|
|
|
@ -13,8 +13,13 @@ def copy_dir(src_dir, dest_dir):
|
||||||
#print "Copying directory "+os.path.realpath(src_dir)+" to "+os.path.realpath(dest_dir)
|
#print "Copying directory "+os.path.realpath(src_dir)+" to "+os.path.realpath(dest_dir)
|
||||||
shutil.copytree(src_dir, dest_dir)
|
shutil.copytree(src_dir, dest_dir)
|
||||||
|
|
||||||
|
PATH_INI_FILE = '/etc/airtime/api_client.cfg'
|
||||||
|
|
||||||
current_script_dir = get_current_script_dir()
|
current_script_dir = get_current_script_dir()
|
||||||
|
|
||||||
|
if not os.path.exists(PATH_INI_FILE):
|
||||||
|
shutil.copy('%s/../api_client.cfg'%current_script_dir, PATH_INI_FILE)
|
||||||
|
|
||||||
"""load config file"""
|
"""load config file"""
|
||||||
try:
|
try:
|
||||||
config = ConfigObj("%s/../api_client.cfg" % current_script_dir)
|
config = ConfigObj("%s/../api_client.cfg" % current_script_dir)
|
||||||
|
|
|
@ -27,17 +27,20 @@ def create_dir(path):
|
||||||
|
|
||||||
PATH_INI_FILE = '/etc/airtime/media-monitor.cfg'
|
PATH_INI_FILE = '/etc/airtime/media-monitor.cfg'
|
||||||
|
|
||||||
# load config file
|
|
||||||
try:
|
|
||||||
config = ConfigObj(PATH_INI_FILE)
|
|
||||||
except Exception, e:
|
|
||||||
print 'Error loading config file: ', e
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Absolute path this script is in
|
# Absolute path this script is in
|
||||||
current_script_dir = get_current_script_dir()
|
current_script_dir = get_current_script_dir()
|
||||||
|
|
||||||
|
if not os.path.exists(PATH_INI_FILE):
|
||||||
|
shutil.copy('%s/../media-monitor.cfg'%current_script_dir, PATH_INI_FILE)
|
||||||
|
|
||||||
|
# load config file
|
||||||
|
try:
|
||||||
|
config = ConfigObj(PATH_INI_FILE)
|
||||||
|
except Exception, e:
|
||||||
|
print 'Error loading config file: ', e
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
#copy monit files
|
#copy monit files
|
||||||
shutil.copy('%s/../monit-airtime-media-monitor.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
shutil.copy('%s/../monit-airtime-media-monitor.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||||
shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||||
|
|
|
@ -8,7 +8,7 @@ if os.geteuid() != 0:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print "Waiting for media-monitor processes to stop...",
|
print "Waiting for media-monitor processes to stop...",
|
||||||
if (os.path.exists('/etc/init.d/airtime-playout')):
|
if (os.path.exists('/etc/init.d/airtime-media-monitor')):
|
||||||
p = Popen("/etc/init.d/airtime-media-monitor stop", shell=True)
|
p = Popen("/etc/init.d/airtime-media-monitor stop", shell=True)
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
print "OK"
|
print "OK"
|
||||||
|
|
|
@ -27,17 +27,20 @@ def create_dir(path):
|
||||||
|
|
||||||
PATH_INI_FILE = '/etc/airtime/pypo.cfg'
|
PATH_INI_FILE = '/etc/airtime/pypo.cfg'
|
||||||
|
|
||||||
# load config file
|
|
||||||
try:
|
|
||||||
config = ConfigObj(PATH_INI_FILE)
|
|
||||||
except Exception, e:
|
|
||||||
print 'Error loading config file: ', e
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Absolute path this script is in
|
# Absolute path this script is in
|
||||||
current_script_dir = get_current_script_dir()
|
current_script_dir = get_current_script_dir()
|
||||||
|
|
||||||
|
if not os.path.exists(PATH_INI_FILE):
|
||||||
|
shutil.copy('%s/../pypo.cfg'%current_script_dir, PATH_INI_FILE)
|
||||||
|
|
||||||
|
# load config file
|
||||||
|
try:
|
||||||
|
config = ConfigObj(PATH_INI_FILE)
|
||||||
|
except Exception, e:
|
||||||
|
print 'Error loading config file: ', e
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
#copy monit files
|
#copy monit files
|
||||||
shutil.copy('%s/../monit-airtime-playout.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
shutil.copy('%s/../monit-airtime-playout.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||||
shutil.copy('%s/../monit-airtime-liquidsoap.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
shutil.copy('%s/../monit-airtime-liquidsoap.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||||
|
|
|
@ -38,14 +38,14 @@ echo -e "\n*** Creating Virtualenv for Airtime ***"
|
||||||
EXTRAOPTION=$(virtualenv --help | grep extra-search-dir)
|
EXTRAOPTION=$(virtualenv --help | grep extra-search-dir)
|
||||||
|
|
||||||
if [ "$?" -eq "0" ]; then
|
if [ "$?" -eq "0" ]; then
|
||||||
virtualenv --extra-search-dir=${SCRIPTPATH}/3rd_party --no-site-package -p /usr/bin/python2.6 /usr/lib/airtime/airtime_virtualenv || exit 1
|
virtualenv --extra-search-dir=${SCRIPTPATH}/3rd_party --no-site-package -p /usr/bin/python2.6 /usr/lib/airtime/airtime_virtualenv 2>/dev/null || exit 1
|
||||||
else
|
else
|
||||||
# copy distribute-0.6.10.tar.gz to /usr/share/python-virtualenv/
|
# copy distribute-0.6.10.tar.gz to /usr/share/python-virtualenv/
|
||||||
# this is due to the bug in virtualenv 1.4.9
|
# this is due to the bug in virtualenv 1.4.9
|
||||||
if [ -d "$VIRTUAL_ENV_SHARE" ]; then
|
if [ -d "$VIRTUAL_ENV_SHARE" ]; then
|
||||||
cp ${SCRIPTPATH}/3rd_party/distribute-0.6.10.tar.gz /usr/share/python-virtualenv/
|
cp ${SCRIPTPATH}/3rd_party/distribute-0.6.10.tar.gz /usr/share/python-virtualenv/
|
||||||
fi
|
fi
|
||||||
virtualenv --no-site-package -p /usr/bin/python2.6 /usr/lib/airtime/airtime_virtualenv || exit 1
|
virtualenv --no-site-package -p /usr/bin/python2.6 /usr/lib/airtime/airtime_virtualenv 2>/dev/null || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\n*** Installing Python Libraries ***"
|
echo -e "\n*** Installing Python Libraries ***"
|
||||||
|
|
|
@ -27,17 +27,21 @@ def create_dir(path):
|
||||||
|
|
||||||
PATH_INI_FILE = '/etc/airtime/recorder.cfg'
|
PATH_INI_FILE = '/etc/airtime/recorder.cfg'
|
||||||
|
|
||||||
# load config file
|
|
||||||
try:
|
|
||||||
config = ConfigObj(PATH_INI_FILE)
|
|
||||||
except Exception, e:
|
|
||||||
print 'Error loading config file: ', e
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Absolute path this script is in
|
# Absolute path this script is in
|
||||||
current_script_dir = get_current_script_dir()
|
current_script_dir = get_current_script_dir()
|
||||||
|
|
||||||
|
if not os.path.exists(PATH_INI_FILE):
|
||||||
|
shutil.copy('%s/../recorder.cfg'%current_script_dir, PATH_INI_FILE)
|
||||||
|
|
||||||
|
# load config file
|
||||||
|
try:
|
||||||
|
config = ConfigObj(PATH_INI_FILE)
|
||||||
|
except Exception, e:
|
||||||
|
print 'Error loading config file: ', e
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
#copy monit files
|
#copy monit files
|
||||||
shutil.copy('%s/../monit-airtime-show-recorder.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
shutil.copy('%s/../monit-airtime-show-recorder.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||||
shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||||
|
|
|
@ -8,7 +8,7 @@ if os.geteuid() != 0:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print "Waiting for show-recorder processes to stop...",
|
print "Waiting for show-recorder processes to stop...",
|
||||||
if (os.path.exists('/etc/init.d/airtime-playout')):
|
if (os.path.exists('/etc/init.d/airtime-show-recorder')):
|
||||||
p = Popen("/etc/init.d/airtime-show-recorder stop", shell=True)
|
p = Popen("/etc/init.d/airtime-show-recorder stop", shell=True)
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
print "OK"
|
print "OK"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue