Skip to content
Snippets Groups Projects
Commit 72e9e862 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

rename "tcp" --> "tcp-port"; war on missing replacements

parent 09bae785
No related branches found
No related tags found
1 merge request!129Db Profiles
......@@ -99,7 +99,7 @@ function dbdetect.exists(){
ini.set "$_config" "detect"
# --- check tcp
local tcpport; tcpport=$( ini.value "tcp" )
local tcpport; tcpport=$( ini.value "tcp-port" )
if [ -n "$tcpport" ]; then
local tcptarget; tcptarget=$( ini.value "tcp-target" )
tcptarget=${tcptarget:-localhost}
......@@ -176,11 +176,10 @@ function dbdetect.exists(){
local dbuser=$( ini.value "dbuser" )
local dbpassword=$( ini.value "dbpassword" )
for mykey in su env params
for mykey in env params
do
value="$( ini.value "$mykey" )"
value="${value//\{\{tcp\}\}/$tcpport}"
value="${value//\{\{tcpport\}\}/$tcpport}"
value="${value//\{\{tcp-target\}\}/$tcptarget}"
value="${value//\{\{dbuser\}\}/$dbuser}"
value="${value//\{\{dbpassword\}\}/$dbpassword}"
......
......@@ -35,7 +35,7 @@ varsCan="
detect.binary
detect.process
detect.tcp:[0-9]*
detect.tcp-port:[0-9]*
detect.tcp-target
detect.tcp-process
detect.type:sqlite
......
......@@ -6,7 +6,7 @@
[detect]
tcp = 5984
tcp-port = 5984
tcp-target = localhost
tcp-process = 'beam.smp'
......
......@@ -7,7 +7,7 @@
[detect]
# process = 'slapd'
tcp = 636
tcp-port = 636
tcp-target = localhost
tcp-process = 'slapd'
......
......@@ -7,7 +7,7 @@
[detect]
process = 'mysqld|mariadb'
tcp = 3306
tcp-port = 3306
tcp-target = localhost
tcp-process = 'mysqld|mariadbd'
......
......@@ -7,7 +7,7 @@
[detect]
process = 'postgres|postmaster'
tcp = 5432
tcp-port = 5432
tcp-target = localhost
tcp-process = 'postgres|postmaster'
......@@ -26,7 +26,7 @@ dbpassword = ''
; -w, --no-password never prompt for password
; -W, --password force password prompt (should happen automatically)
;
# params = '--host= {{tcp-target}} --port={tcp}} --username={{dbuser}} --no-password'
# params = '--host= {{tcp-target}} --port={{tcp-port}} --username={{dbuser}} --no-password'
# https://www.postgresql.org/docs/current/libpq-envars.html
......
......@@ -8,7 +8,7 @@
[detect]
process = 'postgres|postmaster'
tcp = 5432
tcp-port = 5432
tcp-target = dbserver.example.com
tcp-process = 'postgres|postmaster'
......@@ -19,7 +19,7 @@ su = ''
dbuser = 'mydbuser'
dbpassword = 'mypassword'
params = '--host= {{tcp-target}} --port={tcp}} --username={{dbuser}}'
params = '--host= {{tcp-target}} --port={{tcp-port}} --username={{dbuser}}'
env = 'PGPASSWORD={{dbpassword}}'
# https://www.postgresql.org/docs/current/libpq-envars.html
......
......@@ -66,9 +66,9 @@ Replacements that can be used for values `params` and `env`:
| Key | Description |
|--- |--- |
| {{tcp}} | value of [detect] -> tcp
| {{dbpassword}} | value of [set] -> dbpassword
| {{dbuser}} | value of [set] -> dbuser
| {{tcp-port}} | value of [detect] -> tcp-port
| {{tcp-target}} | value of [detect] -> tcp-target
```ini
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment