use property, not key anymore

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-04-04 10:59:04 +02:00
parent 4b76d8a7e0
commit db425d3925

View file

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# 2011 Steven Armstrong (steven-cdist at armstrong.cc) # 2011 Steven Armstrong (steven-cdist at armstrong.cc)
# 2011 Nico Schottelius (nico-cdist at schottelius.org)
# #
# This file is part of cdist. # This file is part of cdist.
# #
@ -30,7 +31,7 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then
file="$__object/explorer/passwd" file="$__object/explorer/passwd"
case "$key" in case "$property" in
password) password)
field=3 field=3
file="$__object/explorer/shadow" file="$__object/explorer/shadow"
@ -50,18 +51,15 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then
shell) field=7 ;; shell) field=7 ;;
esac esac
export field
current_value="$(awk -F: '{ print $ENVIRON["field"] }' < "$file")" current_value="$(awk -F: '{ print $ENVIRON["field"] }' < "$file")"
if [ "$new_value" != "$current_value" ]; then if [ "$new_value" != "$current_value" ]; then
# Shedule changed properties for update
set -- "$@" "--$property" \"$new_value\" set -- "$@" "--$property" \"$new_value\"
fi fi
done done
if [ $# -gt 0 ]; then [ $# -gt 0 ] && echo usermod "$@" "$name"
# Update changed properties
echo usermod "$@" "$name"
fi
else else
for property in $(ls .); do for property in $(ls .); do
new_value="$(cat "$property")" new_value="$(cat "$property")"