Locally sort remote group information, to prevent differences in sort output.
This commit is contained in:
parent
61fc5e5de8
commit
b7394ff4c2
2 changed files with 5 additions and 3 deletions
|
@ -20,4 +20,4 @@
|
||||||
|
|
||||||
user="$(cat "$__object/parameter/user" 2>/dev/null || echo "$__object_id")"
|
user="$(cat "$__object/parameter/user" 2>/dev/null || echo "$__object_id")"
|
||||||
|
|
||||||
(id -G -n "$user" | tr ' ' '\n' | sort) 2>/dev/null || true
|
(id -G -n "$user" | tr ' ' '\n') 2>/dev/null || true
|
||||||
|
|
|
@ -26,13 +26,15 @@ os=$(cat "$__global/explorer/os")
|
||||||
mkdir "$__object/files"
|
mkdir "$__object/files"
|
||||||
# file has to be sorted for comparison with `comm`
|
# file has to be sorted for comparison with `comm`
|
||||||
sort "$__object/parameter/group" > "$__object/files/group.sorted"
|
sort "$__object/parameter/group" > "$__object/files/group.sorted"
|
||||||
|
# Use local sort for remote groups
|
||||||
|
sort "$__object/explorer/group" > "$__object/files/group-remote.sorted"
|
||||||
|
|
||||||
case "$state_should" in
|
case "$state_should" in
|
||||||
present)
|
present)
|
||||||
changed_groups="$(comm -13 "$__object/explorer/group" "$__object/files/group.sorted")"
|
changed_groups="$(comm -13 "$__object/files/group-remote.sorted" "$__object/files/group.sorted")"
|
||||||
;;
|
;;
|
||||||
absent)
|
absent)
|
||||||
changed_groups="$(comm -12 "$__object/explorer/group" "$__object/files/group.sorted")"
|
changed_groups="$(comm -12 "$__object/files/group-remote.sorted" "$__object/files/group.sorted")"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue