2014-12-17 22:42:29 +01:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
debug="f"
|
|
|
|
|
|
|
|
showhelp () {
|
|
|
|
echo "Usage: airtime-liquidsoap [options]
|
|
|
|
--help|-h Displays usage information.
|
|
|
|
--debug|-d Print error messages to console"
|
|
|
|
}
|
|
|
|
|
|
|
|
set -- $(getopt -l help,debug "hd" "$@")
|
|
|
|
while [ $# -gt 0 ]
|
|
|
|
do
|
|
|
|
case "$1" in
|
|
|
|
(-h|--help) showhelp; exit 0;;
|
|
|
|
(-d|--debug) debug="t";;
|
|
|
|
|
|
|
|
(--) shift; break;;
|
|
|
|
(-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;;
|
|
|
|
(*) break;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2015-01-05 20:42:53 +01:00
|
|
|
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
|
|
|
. ${virtualenv_bin}activate
|
2014-12-17 22:42:29 +01:00
|
|
|
|
|
|
|
export HOME="/var/tmp/airtime/pypo/"
|
2014-12-19 19:49:33 +01:00
|
|
|
if [ "$debug" = "t" ]; then
|
2014-12-17 22:42:29 +01:00
|
|
|
ls_path="/usr/bin/airtime-liquidsoap --verbose -f"
|
|
|
|
else
|
|
|
|
ls_path="/usr/bin/airtime-liquidsoap --verbose -f -d"
|
|
|
|
fi
|
2015-01-05 21:38:01 +01:00
|
|
|
|
|
|
|
export PYTHONPATH=/usr/lib/airtime
|
2014-12-17 22:42:29 +01:00
|
|
|
ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq"
|
|
|
|
|
2014-12-19 19:49:33 +01:00
|
|
|
cd /usr/lib/airtime/pypo/bin/liquidsoap_scripts
|
2014-12-17 22:42:29 +01:00
|
|
|
python generate_liquidsoap_cfg.py
|
|
|
|
|
|
|
|
exec ${ls_path} ${ls_param} 2>&1
|