CC-3791: Media Monitor crash when there are media files with non-ascii name in watched folder

-move utf-8 locale check to bash
This commit is contained in:
Martin Konecny 2012-05-14 19:46:53 -04:00
parent c1d33e9f72
commit c397a6f797
4 changed files with 20 additions and 16 deletions

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
. ${virtualenv_bin}activate
@ -12,6 +12,14 @@ pypo_script="pypocli.py"
cd ${pypo_path}
exec 2>&1
set +e
cat /etc/default/locale | grep -i "LANG=.*UTF-\?8"
set -e
if [ "$?" != "0" ]; then
echo "non UTF-8 default locale found in /etc/default/locale." > /var/log/airtime/pypo/error.log
exit 1
fi
export HOME="/var/tmp/airtime/pypo/"
export PYTHONPATH=${api_client_path}:$PYTHONPATH
export LC_ALL=`cat /etc/default/locale | grep "LANG=" | cut -d= -f2 | tr -d "\n\""`