add parameter parsing to airtime-liquidsoap script.
-Allow us to prevent running as daemon
This commit is contained in:
parent
f3edc2bee6
commit
80686b7063
1 changed files with 28 additions and 1 deletions
|
@ -1,11 +1,38 @@
|
||||||
#!/bin/bash -e
|
#!/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
|
||||||
|
|
||||||
|
|
||||||
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||||
. ${virtualenv_bin}activate
|
. ${virtualenv_bin}activate
|
||||||
|
|
||||||
export HOME="/var/tmp/airtime/pypo/"
|
export HOME="/var/tmp/airtime/pypo/"
|
||||||
api_client_path="/usr/lib/airtime/"
|
api_client_path="/usr/lib/airtime/"
|
||||||
ls_path="/usr/bin/airtime-liquidsoap --verbose -f -d"
|
if [ $debug = "t" ]; then
|
||||||
|
ls_path="/usr/bin/airtime-liquidsoap --verbose -f"
|
||||||
|
else
|
||||||
|
ls_path="/usr/bin/airtime-liquidsoap --verbose -f -d"
|
||||||
|
fi
|
||||||
ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq"
|
ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq"
|
||||||
|
|
||||||
export PYTHONPATH=${api_client_path}
|
export PYTHONPATH=${api_client_path}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue