1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-12-04 14:46:31 -05: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
.Bk -words
.Op Fl hqrVv
.Op Fl p Ar pidfile
.Op Fl T Ar cfg_template
.Op Ar
.Ek
@ -60,6 +61,17 @@ binary.
.It Fl h
Print a summary of available command line parameters with short descriptions
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
.Po
Passed to

View File

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