Skip to content

Commit

Permalink
Merge pull request #821 from qowoz/users
Browse files Browse the repository at this point in the history
users: fix `forceRecreate` bash comparison
  • Loading branch information
Enzime authored Mar 4, 2024
2 parents 1032f09 + 0b638a9 commit e7d7a7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/users/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,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
Expand Down Expand Up @@ -149,7 +149,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
Expand Down

0 comments on commit e7d7a7f

Please sign in to comment.