nixos/geoipupdate: Add error handling to scripts

main
talyz 2 years ago
parent 5d0fa80cce
commit 23c15323ce
No known key found for this signature in database
GPG Key ID: 2DED2151F4671A2B
  1. 6
      nixos/modules/services/misc/geoipupdate.nix

@ -102,6 +102,9 @@ in
systemd.services.geoipupdate-create-db-dir = {
serviceConfig.Type = "oneshot";
script = ''
set -o errexit -o pipefail -o nounset -o errtrace
shopt -s inherit_errexit
mkdir -p ${cfg.settings.DatabaseDirectory}
chmod 0755 ${cfg.settings.DatabaseDirectory}
'';
@ -135,6 +138,9 @@ in
geoipupdateConf = pkgs.writeText "geoipupdate.conf" (geoipupdateKeyValue cfg.settings);
script = ''
set -o errexit -o pipefail -o nounset -o errtrace
shopt -s inherit_errexit
chown geoip "${cfg.settings.DatabaseDirectory}"
cp ${geoipupdateConf} /run/geoipupdate/GeoIP.conf

Loading…
Cancel
Save