mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
nixos/geoipupdate: Add error handling to scripts
This commit is contained in:
parent
5d0fa80cce
commit
23c15323ce
@ -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…
Reference in New Issue
Block a user