From 72e9e862b1f6b77f9777704b192e787f1d33ad6c Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch> Date: Wed, 13 Mar 2024 15:12:40 +0100 Subject: [PATCH] rename "tcp" --> "tcp-port"; war on missing replacements --- includes/dbdetect.class.sh | 7 +++---- includes/dbdetect_validate_profile_ini.sh | 2 +- plugins/localdump/profiles/couchdb2.ini | 2 +- plugins/localdump/profiles/ldap.ini | 2 +- plugins/localdump/profiles/mysql.ini | 2 +- plugins/localdump/profiles/pgsql.ini | 4 ++-- plugins/localdump/profiles/pgsql_remote.ini.example | 4 ++-- plugins/localdump/profiles/readme.md | 2 +- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/includes/dbdetect.class.sh b/includes/dbdetect.class.sh index 227098f..9e93ba8 100644 --- a/includes/dbdetect.class.sh +++ b/includes/dbdetect.class.sh @@ -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}" diff --git a/includes/dbdetect_validate_profile_ini.sh b/includes/dbdetect_validate_profile_ini.sh index 03b8902..fa4d500 100644 --- a/includes/dbdetect_validate_profile_ini.sh +++ b/includes/dbdetect_validate_profile_ini.sh @@ -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 diff --git a/plugins/localdump/profiles/couchdb2.ini b/plugins/localdump/profiles/couchdb2.ini index 72d42d6..b31a78b 100644 --- a/plugins/localdump/profiles/couchdb2.ini +++ b/plugins/localdump/profiles/couchdb2.ini @@ -6,7 +6,7 @@ [detect] -tcp = 5984 +tcp-port = 5984 tcp-target = localhost tcp-process = 'beam.smp' diff --git a/plugins/localdump/profiles/ldap.ini b/plugins/localdump/profiles/ldap.ini index fff0e6b..62917ca 100644 --- a/plugins/localdump/profiles/ldap.ini +++ b/plugins/localdump/profiles/ldap.ini @@ -7,7 +7,7 @@ [detect] # process = 'slapd' -tcp = 636 +tcp-port = 636 tcp-target = localhost tcp-process = 'slapd' diff --git a/plugins/localdump/profiles/mysql.ini b/plugins/localdump/profiles/mysql.ini index 654df4d..3f760a8 100644 --- a/plugins/localdump/profiles/mysql.ini +++ b/plugins/localdump/profiles/mysql.ini @@ -7,7 +7,7 @@ [detect] process = 'mysqld|mariadb' -tcp = 3306 +tcp-port = 3306 tcp-target = localhost tcp-process = 'mysqld|mariadbd' diff --git a/plugins/localdump/profiles/pgsql.ini b/plugins/localdump/profiles/pgsql.ini index 07fc641..bbb24f6 100644 --- a/plugins/localdump/profiles/pgsql.ini +++ b/plugins/localdump/profiles/pgsql.ini @@ -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 diff --git a/plugins/localdump/profiles/pgsql_remote.ini.example b/plugins/localdump/profiles/pgsql_remote.ini.example index 696d7ba..9249611 100644 --- a/plugins/localdump/profiles/pgsql_remote.ini.example +++ b/plugins/localdump/profiles/pgsql_remote.ini.example @@ -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 diff --git a/plugins/localdump/profiles/readme.md b/plugins/localdump/profiles/readme.md index 4a7f7a6..7afa5ab 100644 --- a/plugins/localdump/profiles/readme.md +++ b/plugins/localdump/profiles/readme.md @@ -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 -- GitLab