Browse Source

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

pull/846/head
aler9 4 years ago
parent
commit
d3bf643f77
  1. 2
      internal/core/core_test.go
  2. 2
      internal/core/path.go
  3. 8
      rtsp-simple-server.yml

2
internal/core/core_test.go

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

2
internal/core/path.go

@ -526,7 +526,7 @@ func (pa *path) externalCmdEnv() externalcmd.Environment { @@ -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
}
}

8
rtsp-simple-server.yml

@ -211,7 +211,7 @@ paths: @@ -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: @@ -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: @@ -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: @@ -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.

Loading…
Cancel
Save