mirror of
https://github.com/SuperSandro2000/nixos-modules.git
synced 2024-06-14 03:46:57 +02:00
postgres: exit if up to date
This commit is contained in:
parent
5c68301e93
commit
85bdc26d2d
|
@ -38,10 +38,17 @@ in
|
|||
newBin = "${cfg.newPackage}/bin";
|
||||
oldData = config.services.postgresql.dataDir;
|
||||
oldBin = "${config.services.postgresql.package}/bin";
|
||||
currPkg = config.services.postgresql.package;
|
||||
in
|
||||
pkgs.writeScriptBin "upgrade-pg-cluster" /* bash */ ''
|
||||
set -eux
|
||||
|
||||
if [[ ${cfg.newPackage} == ${currPkg} ]]; then
|
||||
echo "There is no major postgres update available."
|
||||
echo "Current version: ${currPkg.version}"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
systemctl stop --wait postgresql ${lib.concatStringsSep " " cfg.stopServices}
|
||||
|
||||
install -d -m 0700 -o postgres -g postgres "${newData}"
|
||||
|
|
Loading…
Reference in New Issue
Block a user