From 0b638a97c069ca331daf657eab2c47ce44aae916 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Mon, 4 Dec 2023 10:27:18 +1000 Subject: [PATCH] users: fix `forceRecreate` bash comparison --- modules/users/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/users/default.nix b/modules/users/default.nix index 571200248..c79ee42fc 100644 --- a/modules/users/default.nix +++ b/modules/users/default.nix @@ -92,7 +92,7 @@ in ${optionalString cfg.forceRecreate '' g=$(dscl . -read '/Groups/${v.name}' PrimaryGroupID 2> /dev/null) || true g=''${g#PrimaryGroupID: } - if [ "$g" -eq ${toString v.gid} ]; then + if [[ "$g" -eq ${toString v.gid} ]]; then echo "deleting group ${v.name}..." >&2 dscl . -delete '/Groups/${v.name}' 2> /dev/null else @@ -141,7 +141,7 @@ in ${optionalString cfg.forceRecreate '' u=$(dscl . -read '/Users/${v.name}' UniqueID 2> /dev/null) || true u=''${u#UniqueID: } - if [ "$u" -eq ${toString v.uid} ]; then + if [[ "$u" -eq ${toString v.uid} ]]; then echo "deleting user ${v.name}..." >&2 dscl . -delete '/Users/${v.name}' 2> /dev/null else