diff --git a/includes/dbdetect.class.sh b/includes/dbdetect.class.sh index 227098f94403795a4b6bf14b33a9c85efdcf3eb7..9e93ba83f2cb513d947f9c9610f1dbd0c370cbe9 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 03b8902d4affc3006cc802701231b8970cf6ed3c..fa4d500470c1e14cb8675b6c37216a94524cd3a5 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 72d42d68b22a8e4f5ae3326e46baf26dfc7a89bc..b31a78b4eb69fea85e901fe62aa5ad75a305f80e 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 fff0e6ba7e98eca42cfee65e387a05529152ad1d..62917ca4d119b0d29f8a37c197d2cc94d48dd033 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 654df4d2199275fa4ebc4df26c3850915390303a..3f760a8386e4bd96e9f99739d0c8b2ba87abce94 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 07fc641f2484dbf787770b3c02ba2a5b652ea533..bbb24f6b4b5cc8a11d17de74e12514a692ccb995 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 696d7bac9d2e8d6f9b089403e3dfeb004b9e379e..92496110daffa07268bad1a3be7148bdd350fedd 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 4a7f7a6a6fd3600d4ec577d2b7feef16d1518f01..7afa5abaa66eee785929f2e9696165be7d365991 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