From db425d39254c35c8fa8ba85678dafced87ef64ba Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 10:59:04 +0200 Subject: [PATCH] use property, not key anymore Signed-off-by: Nico Schottelius --- conf/type/__user/gencode-remote | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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")"