Browse Source

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

pull/846/head
aler9 5 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 (
) )
func main() { func main() {
if os.Getenv("1") != "on" { if os.Getenv("G1") != "on" {
panic("environment not set") panic("environment not set")
} }

2
internal/core/path.go

@ -526,7 +526,7 @@ func (pa *path) externalCmdEnv() externalcmd.Environment {
if len(pa.matches) > 1 { if len(pa.matches) > 1 {
for i, ma := range 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:
# The following environment variables are available: # The following environment variables are available:
# * RTSP_PATH: path name # * RTSP_PATH: path name
# * RTSP_PORT: server port # * 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. # a regular expression.
runOnInit: runOnInit:
# Restart the command if it exits suddenly. # Restart the command if it exits suddenly.
@ -223,7 +223,7 @@ paths:
# The following environment variables are available: # The following environment variables are available:
# * RTSP_PATH: path name # * RTSP_PATH: path name
# * RTSP_PORT: server port # * 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. # a regular expression.
runOnDemand: runOnDemand:
# Restart the command if it exits suddenly. # Restart the command if it exits suddenly.
@ -241,7 +241,7 @@ paths:
# The following environment variables are available: # The following environment variables are available:
# * RTSP_PATH: path name # * RTSP_PATH: path name
# * RTSP_PORT: server port # * 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. # a regular expression.
runOnReady: runOnReady:
# Restart the command if it exits suddenly. # Restart the command if it exits suddenly.
@ -252,7 +252,7 @@ paths:
# The following environment variables are available: # The following environment variables are available:
# * RTSP_PATH: path name # * RTSP_PATH: path name
# * RTSP_PORT: server port # * 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. # a regular expression.
runOnRead: runOnRead:
# Restart the command if it exits suddenly. # Restart the command if it exits suddenly.

Loading…
Cancel
Save