1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-06-02 06:01:10 +00:00

Add ezstream-file support for -p pidfile

This commit is contained in:
Moritz Grimm 2017-11-18 01:20:55 +01:00
parent cc5a3ab5d3
commit f82cf2b458
2 changed files with 23 additions and 3 deletions

View File

@ -22,6 +22,7 @@
.Nm .Nm
.Bk -words .Bk -words
.Op Fl hqrVv .Op Fl hqrVv
.Op Fl p Ar pidfile
.Op Fl T Ar cfg_template .Op Fl T Ar cfg_template
.Op Ar .Op Ar
.Ek .Ek
@ -60,6 +61,17 @@ binary.
.It Fl h .It Fl h
Print a summary of available command line parameters with short descriptions Print a summary of available command line parameters with short descriptions
and exit. and exit.
.It Fl p Ar pidfile
.Po
Passed to
.Nm ezstream .
.Pc
Write the
.Nm
process ID
.Pq a single number
to
.Ar pidfile .
.It Fl q .It Fl q
.Po .Po
Passed to Passed to

View File

@ -21,7 +21,7 @@
_myname="$(basename $0)" _myname="$(basename $0)"
_filename_placeholder="%FILENAME%" _filename_placeholder="%FILENAME%"
_opt_string="hqrT:Vv" _opt_string="hp:qrT:Vv"
print_usage() print_usage()
{ {
echo "usage: ${_myname} [-hqrVv] [-T cfg_template] [file ...]" >&2 echo "usage: ${_myname} [-hqrVv] [-T cfg_template] [file ...]" >&2
@ -32,11 +32,12 @@ print_usage_help()
cat << __EOT >&2 cat << __EOT >&2
-h print this help and exit -h print this help and exit
-p pidfile [ezstream] write PID to pidfile
-q [ezstream] suppress STDERR output from external en-/decoders -q [ezstream] suppress STDERR output from external en-/decoders
-r [ezstream] show real-time stream information on stdout -r [ezstream] show real-time stream information on stdout
-T template run ezstream using template for configuration -T template run ezstream using template for configuration
-V print the version number and exit -V print the version number and exit
-v [ezstream] verbose output (use twice for more effect) -v [ezstream] increase logging verbosity
The configuration template must contain the configuration statement The configuration template must contain the configuration statement
<filename>${_filename_placeholder}</filename> <filename>${_filename_placeholder}</filename>
@ -46,6 +47,8 @@ See the ezstream-file.sh(1) manual for detailed information.
__EOT __EOT
} }
_pidfile=""
_pidfile_arg=""
_quiet="" _quiet=""
_rtstatus="" _rtstatus=""
_verbose="" _verbose=""
@ -65,6 +68,10 @@ do
print_usage_help print_usage_help
exit 0 exit 0
;; ;;
-p)
_pidfile="-p"
_pidfile_arg="$2"
shift; shift ;;
-q) -q)
_quiet="-q"; shift ;; _quiet="-q"; shift ;;
-r) -r)
@ -141,6 +148,7 @@ else
done done
fi fi
${EZSTREAM} ${_quiet} ${_rtstatus} ${_verbose} -c "${_cfg}" ${EZSTREAM} ${_quiet} ${_rtstatus} ${_verbose} ${_pidfile} ${_pidfile_arg} \
-c "${_cfg}"
exit $? exit $?