save regexp groups in G1, G2 env variables instead of 1, 2 (#642)

This commit is contained in:
aler9 2022-01-25 14:38:57 +01:00
parent c208cb9aff
commit d3bf643f77
3 changed files with 6 additions and 6 deletions

View File

@ -214,7 +214,7 @@ import (
)
func main() {
if os.Getenv("1") != "on" {
if os.Getenv("G1") != "on" {
panic("environment not set")
}

View File

@ -526,7 +526,7 @@ func (pa *path) externalCmdEnv() externalcmd.Environment {
if len(pa.matches) > 1 {
for i, ma := range pa.matches[1:] {
env[strconv.FormatInt(int64(i+1), 10)] = ma
env["G"+strconv.FormatInt(int64(i+1), 10)] = ma
}
}

View File

@ -211,7 +211,7 @@ paths:
# The following environment variables are available:
# * RTSP_PATH: path name
# * RTSP_PORT: server port
# * 1, 2, ...: regular expression groups, if path name is
# * G1, G2, ...: regular expression groups, if path name is
# a regular expression.
runOnInit:
# Restart the command if it exits suddenly.
@ -223,7 +223,7 @@ paths:
# The following environment variables are available:
# * RTSP_PATH: path name
# * RTSP_PORT: server port
# * 1, 2, ...: regular expression groups, if path name is
# * G1, G2, ...: regular expression groups, if path name is
# a regular expression.
runOnDemand:
# Restart the command if it exits suddenly.
@ -241,7 +241,7 @@ paths:
# The following environment variables are available:
# * RTSP_PATH: path name
# * RTSP_PORT: server port
# * 1, 2, ...: regular expression groups, if path name is
# * G1, G2, ...: regular expression groups, if path name is
# a regular expression.
runOnReady:
# Restart the command if it exits suddenly.
@ -252,7 +252,7 @@ paths:
# The following environment variables are available:
# * RTSP_PATH: path name
# * RTSP_PORT: server port
# * 1, 2, ...: regular expression groups, if path name is
# * G1, G2, ...: regular expression groups, if path name is
# a regular expression.
runOnRead:
# Restart the command if it exits suddenly.