Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
2456e8fa
Verified
Commit
2456e8fa
authored
Nov 23, 2018
by
Florian Pritz
Browse files
upgrade_pg.sh: Add safety check to prevent multiple runs
Signed-off-by:
Florian Pritz
<
bluewind@xinu.at
>
parent
73da9760
Changes
1
Hide whitespace changes
Inline
Side-by-side
roles/postgres/files/upgrade_pg.sh
View file @
2456e8fa
...
...
@@ -13,6 +13,11 @@ if [[ ${to_major} -ne 11 ]]; then
fi
export
FROM_VERSION
=
"
$(
cat
/var/lib/postgres/data/PG_VERSION
)
"
if
[[
"
$FROM_VERSION
"
==
"
$TO_VERSION
"
]]
;
then
echo
"WARNING: from and to versions are equal. Have you already updated?! Aborting..."
exit
1
fi
# free space check
used_space
=
$(
df
--local
--output
=
pcent /var/lib/postgres/ |
grep
-Po
'[0-9]{1,3}(?=%)'
)
if
[[
${
used_space
}
-ge
50
]]
;
then
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment