1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-05 08:17:01 +00:00

Merge pull request #821 from qowoz/users

users: fix `forceRecreate` bash comparison
This commit is contained in:
Michael Hoang 2024-03-04 16:25:51 +11:00 committed by GitHub
commit e7d7a7f0c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
@ -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