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