[IMP] use [[ instead of [ for conditionals

Replace single bracket [ ] with double bracket [[ ]] for all test
conditionals in the main scripts.

Benefits of [[ over [:
- No need to quote variables (though we still do for consistency)
- Supports regex matching with =~
- Supports pattern matching with == and !=
- && and || work inside [[ ]] without escaping
- More predictable behavior with empty strings
- Is a bash keyword, not an external command

Note: posbox scripts are left unchanged as they appear to be
third-party code imported into the repository.
This commit is contained in:
Stéphan Sainléger
2026-02-02 17:56:04 +01:00
parent 526b27fdec
commit 3fe2e93d3d
2 changed files with 6 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ if ! docker ps | grep -q "$DB_CONTAINER_NAME"; then
fi
EXT_EXISTS=$(query_postgres_container "SELECT 1 FROM pg_extension WHERE extname = 'dblink'" "$DB_NAME") || exit 1
if [ "$EXT_EXISTS" != "1" ]; then
if [[ "$EXT_EXISTS" != "1" ]]; then
query_postgres_container "CREATE EXTENSION dblink;" "$DB_NAME" || exit 1
fi