workflows bugfix empty file with tee

The problem was the cat with the tee (w/o --append) on the same file,
the tee command is sometimes faster than the cat command, so
it truncates the file content before the cat can read it.

The solution was the sed --in-place, so no need to use the cat and tee.
This commit is contained in:
silverqx
2023-01-26 14:44:27 +01:00
parent 0cd4909400
commit 2faec5c471
+2 -3
View File
@@ -252,9 +252,8 @@ jobs:
pgHbaTmpl=$(printf "$pgHbaTmplTmpl" "$DB_PGSQL_DATABASE" "$DB_PGSQL_USERNAME")
sudo cat "$pgHbaConf" | \
sed -E "s/(# +TYPE +DATABASE +USER +ADDRESS +METHOD)/\1$pgHbaTmpl/" | \
sudo tee "$pgHbaConf" > /dev/null
sudo sed --regexp-extended "s/(# +TYPE +DATABASE +USER +ADDRESS +METHOD)/\1$pgHbaTmpl/" \
--in-place "$pgHbaConf"
pgIdentConf="$pg_config_path/pg_ident.conf"