2012-05-15 01:53:07 +02:00
|
|
|
#!/bin/bash
|
2011-04-25 18:49:01 +02:00
|
|
|
|
|
|
|
# Location of pypo_cli.py Python script
|
2011-07-18 23:04:46 +02:00
|
|
|
|
2011-07-19 21:06:35 +02:00
|
|
|
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
2011-07-18 23:04:46 +02:00
|
|
|
. ${virtualenv_bin}activate
|
|
|
|
|
2011-04-25 18:49:01 +02:00
|
|
|
media_monitor_path="/usr/lib/airtime/media-monitor/"
|
2012-04-26 23:50:35 +02:00
|
|
|
media_monitor_script="media_monitor.py"
|
2011-04-25 18:49:01 +02:00
|
|
|
|
2011-07-19 18:07:31 +02:00
|
|
|
api_client_path="/usr/lib/airtime/"
|
2011-07-18 23:04:46 +02:00
|
|
|
|
2011-04-25 18:49:01 +02:00
|
|
|
cd ${media_monitor_path}
|
|
|
|
|
|
|
|
exec 2>&1
|
|
|
|
|
2012-05-15 01:46:53 +02:00
|
|
|
set +e
|
|
|
|
cat /etc/default/locale | grep -i "LANG=.*UTF-\?8"
|
|
|
|
set -e
|
|
|
|
if [ "$?" != "0" ]; then
|
2012-05-15 01:53:07 +02:00
|
|
|
echo "non UTF-8 default locale found in /etc/default/locale." > /var/log/airtime/media-monitor/error.log
|
2012-05-15 01:46:53 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2011-05-12 18:34:30 +02:00
|
|
|
export PYTHONPATH=${api_client_path}
|
2012-05-15 00:35:20 +02:00
|
|
|
export LC_ALL=`cat /etc/default/locale | grep "LANG=" | cut -d= -f2 | tr -d "\n\""`
|
2011-05-31 22:05:48 +02:00
|
|
|
|
|
|
|
# Note the -u when calling python! we need it to get unbuffered binary stdout and stderr
|
2011-06-08 18:33:38 +02:00
|
|
|
exec python -u ${media_monitor_path}${media_monitor_script} > /var/log/airtime/media-monitor/py-interpreter.log 2>&1
|
2011-05-31 22:05:48 +02:00
|
|
|
|
2011-04-25 18:49:01 +02:00
|
|
|
# EOF
|