Browse Source

Fix a variable scope issue

Emmanuel Bouthenot 1 year ago
parent
commit
94f34c62f0
1 changed files with 4 additions and 4 deletions
  1. 4 4
      autopostgresqlbackup

+ 4 - 4
autopostgresqlbackup

@@ -326,17 +326,17 @@ dblist () {
 
 # {{{ dbdump()
 dbdump () {
-    local db cmd_prog cmd_args pg_args
+    local db_name cmd_prog cmd_args pg_args
 
-    db="${1}"
+    db_name="${1}"
     pg_args="${PG_OPTIONS[*]}"
 
-    if [ "${db}" = "${GLOBALS_OBJECTS}" ]; then
+    if [ "${db_name}" = "${GLOBALS_OBJECTS}" ]; then
         cmd_prog="pg_dumpall"
         cmd_args=(--globals-only)
     else
         cmd_prog="pg_dump"
-        cmd_args=("${DB}")
+        cmd_args=("${db_name}")
         if [ "${CREATE_DATABASE}" = "yes" ]; then
             pg_args+=(--create)
         fi