Skip to content

Commit 8f133f2

Browse files
Merge pull request #30 from monobilisim/pgsqlhealth-iasdb-support
feat: allow iasdb user to run script and default wildcard port to 5432 for pgsqlHealth
2 parents a7be139 + 3c8e6f9 commit 8f133f2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pgsqlHealth/connection.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ func Connect() error {
131131
user = parts[3]
132132
password = parts[4]
133133

134+
if port == "*" {
135+
port = "5432"
136+
}
137+
134138
break
135139
}
136140
}

pgsqlHealth/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ func Main(cmd *cobra.Command, args []string) {
9393
version := "4.0.0"
9494
common.ScriptName = "pgsqlHealth"
9595

96-
// Check if user is postgres
97-
if os.Getenv("USER") != "postgres" {
98-
log.Error().Msg("This script must be run as the postgres user")
96+
// Check if user is postgres or iasdb
97+
if os.Getenv("USER") != "postgres" && os.Getenv("USER") != "iasdb" {
98+
log.Error().Msg("This script must be run as the postgres or iasdb user")
9999
return
100100
}
101101

0 commit comments

Comments
 (0)